Re: Why have a ChangeLog file if you already have commit messages?



On Tue, 2007-09-18 at 11:50 -0500, Shaun McCance wrote:

> With git, it's simple as well.  I could, in principle,
> prepare my NEWS entry from git log.  But the messages
> would no longer be grouped as they are with separate
> ChangeLog files.  What's more, it seems most git users
> don't prefix their commit messages with the affected
> files.  So I'd end up seeing a commit message like
> 
>   Updated the Spanish translation
> 

you don't need to prefix the list of affected files, as git log gives
you the commit hash which can be used to get the list of affected files,
as well as the diff.

given any commit hash you can do:

  git-diff-tree --name-only -r $commit_hash

to obtain the list of changed files and

  git-show $commit_hash

to obtain the diff. a nice, simple command is also:

  git-log --stat $commit_hash

which gives you the diffstat. git-log is highly scriptable[0]: for
instance, I wrote a small perl script to generate the ChangeLog from
git-log[1]. another option, is to use giggle which shows you the list of
changed files for each commit (and the latest revision will also
highlight the affected files/directories in the tree).

ciao,
 Emmanuele.

+++

[0] all the git users in GNOME should probably find some time and start
a git-gnome-porcelains repository somewhere, to store all the useful
scripts we use to make our life simpler. :-)
[1] http://www.gnome.org/~ebassi/scripts/git-changelog

-- 
Emmanuele Bassi,
W: http://www.emmanuelebassi.net
B: http://log.emmanuelebassi.net




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]