I am using git gui and now am trying to write a pre-commit hook (which
analyzes a complete diff).
Adding support for amending is a big problem.
1. There seems to be now information whether the current commit is an amend
and as such, you can not analyze the resulting complete diff (only the delta to
the old commit).
2. There seems to be absolutely no way of determining in the pre-commit, that
it was a amend commit.
3. A workaround would be to try to detect whether the hook was called from an
amend command. Even trying to analyze the process tree fails, though. When
calling pstree I get the following output:
`-wish /usr/lib/git-core/git-gui --
So looking at this there is no amend call in the process tree. As such I
expect, that git gui is not using the "standard" amend but has some own way of
amending commits. Is this true?
Is there any way of handling that properly?
I think you need to look carefully at the way the "Index" (or staging area) is
used to distinguish between some of the different commit versions. The current
branch tip may not match the current work tree, and also not match the index
(what would be committed)
The other factor is the potential changed commit object ID (oid), and you can
see the changes to the current HEAD value in the HEAD reflog, or the branch's
Also, from the `git commit --amend` man page "See the "RECOVERING FROM UPSTREAM
REBASE" section in git-rebase.)" (amend is, essentially, a one commit rebase
Hope that helps
You received this message because you are subscribed to the Google Groups "Git
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email
For more options, visit https://groups.google.com/d/optout.