[Xfce4-commits] r28557 - in xfce4-dev-tools/trunk: . scripts

Jannis Pohlmann jannis at xfce.org
Sat Nov 1 22:48:16 CET 2008


Am Sat, 1 Nov 2008 13:18:23 -0700
schrieb "Brian J. Tarricone" <bjt23 at cornell.edu>:

> 
> 
> On Sat, 1 Nov 2008 21:04:18 +0100 Jannis Pohlmann wrote:
> 
> > Am Sat, 1 Nov 2008 09:35:02 -0700
> > schrieb "Brian J. Tarricone" <bjt23 at cornell.edu>:
> > 
> > > On Sat,  1 Nov 2008 11:44:28 +0000 (UTC) Jannis Pohlmann wrote:
> > > 
> > > > Author: jannis
> > > > Date: 2008-11-01 11:44:28 +0000 (Sat, 01 Nov 2008)
> > > > New Revision: 28557
> > > > 
> > > > Modified:
> > > >    xfce4-dev-tools/trunk/ChangeLog
> > > >    xfce4-dev-tools/trunk/scripts/xdt-commit
> > > > Log:
> > > > 	* scripts/xdt-commit: Automatically add ChangeLog files
> > > > of git repositories to the commit with "git add ${CHANGELOG}".
> > > > Use "git diff --cached" instead of "git diff HEAD" for the
> > > > commit messages.
> > > 
> > > Hmm, not sure I like this... wouldn't "git diff HEAD^..HEAD" work
> > > better?
> > 
> > HEAD^..HEAD would print the diff between the previous and the last
> > commit. That's not really useful if you need the diff between HEAD
> > and the future commit. --cached and HEAD do the same, but there is
> > help explicitely available for --cached in the man page:
> > 
> >  git diff [--options] --cached [<commit>] [--] [<path>...]
> > 
> >     This form is to view the changes you staged for the next
> >     commit relative to the named <commit>. Typically you would want
> >     comparison with the latest commit, so if you do not give
> > <commit>, it defaults to HEAD.
> 
> No, I don't think that's the case.  My understanding is that HEAD
> gives you the diff between the last commit and the current state of
> the working tree.  --cached will restrict that to only giving you a
> diff between the last commit and changes in the working tree that
> have been *staged*.  Now, I see you added a line to stage ChangeLog,
> but that just strikes me as kinda wrong.  But in practice it'll of
> course work fine.

Oh, yes. You're right on this difference. However, since versioned
ChangeLogs are staged before the diff call, --cached will always work. 

> My suggestion to use "git diff HEAD^..HEAD" was that in theory it
> means "give me a diff between the last commit from the current HEAD,
> and the current working tree."  But maybe it doesn't... anyway, I
> guess your modification will work all the time even if I don't
> particularly like it ^_^.

I don't feel too strongly about it. We could as well just switch back
to HEAD instead of --cached. The advantage of --cached is that it
only prints those ChangeLog modifications which are going to be
committed. The way the rest of the script works right now it doesn't
really matter which way we choose.

  - Jannis
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://mail.xfce.org/pipermail/xfce4-dev/attachments/20081101/7f647cab/attachment.pgp>


More information about the Xfce4-dev mailing list