Bruno Haible via Gnulib discussion list <[email protected]> writes:

> Hi Simon,
>
> Does the 'git2cl' program have any functional advantage over
> the two similar modules in Gnulib [1][2]?

There are some minor differences:

- git2cl is not FSF copyrighted

- gitlog-to-changelog produces nice outputs when the GNU changelog
  pattern is used in git commit messages, but I found that git2cl
  produces better looking outputs for projects that uses more terse
  one-line git commit messages.  Git2cl automatically lists the relevant
  files, wheras gitlog-to-changelog relies on the git commit author to
  have done this in the commit message.

I still occasionaly maintain git2cl, but I have migrated almost all my
projects from git2cl to gitlog-to-changelog mainly for two reasons:

- The convenience of having gitlog-in-changelog in gnulib is attractive
  for projects already using gnulib.

- I seems to care less and less about human-readable ChangeLog files, so
  the cost to document the requirement on yet another build-time tool
  like git2cl and make sure it is installed in CI is hard to motivate.

I'm not sure what the future for ChangeLog files in tarballs is: for
many realistic and practical purposes, I think 'git log' is better.

One problem with both git2cl and gitlog-to-changelog is that you need
the full git history to produce the same output.  A sparse or partial
git clone results in different output.  So you cannot re-create the
'make dist' tarball from a sparse git checkout, which I think is
problematic from a supply-chain security perspective.  In some projects
I've started to use shorten the ChangeLogs file based on the previous
release tag, so you only need the git history from the last checkout
(which is required anyway because how git-version-gen works):

dist-hook: gen-ChangeLog
.PHONY: gen-ChangeLog
gen-ChangeLog:
        $(AM_V_GEN)if test -e $(srcdir)/.git; then                      \
          LC_ALL=en_US.UTF-8 TZ=UTC0                                    \
            $(top_srcdir)/build-aux/gitlog-to-changelog                 \
              --srcdir=$(srcdir) --                                     \
              v$(PREV_VERSION)~.. > $(distdir)/cl-t &&                  \
            { printf '\n\nSee the source repo for older entries\n'      \
              >> $(distdir)/cl-t &&                                     \
              rm -f $(distdir)/ChangeLog &&                             \
              mv $(distdir)/cl-t $(distdir)/ChangeLog; }                \
        fi

I think the GNU ChangeLog format as a documentation convention is still
very much useful, and the document could be rewritte into a
"git-log-commit-message convention".  There was a good somewhat related
discussion in the Guix community recently (subject 'Revisiting the
"ChangeLog" style.') but lists.gnu.org is down now so I can't link to
it...

> Should we mention it as an alternative in the documentation?

Not necessarily.  I think it is better if most people reach for
gitlog-to-changelog.

/Simon

> Bruno
>
> [1] https://www.gnu.org/software/gnulib/manual/html_node/VCS-To-ChangeLog.html
> [2] 
> https://www.gnu.org/software/gnulib/manual/html_node/gitlog_002dto_002dchangelog.html
>
>
>
>
>

Attachment: signature.asc
Description: PGP signature

  • mention git2cl ? Bruno Haible via Gnulib discussion list
    • Re: mention git2cl ? Simon Josefsson via Gnulib discussion list

Reply via email to