Re: [PATCH 3/3] diffstat generation in hooks--update was passing "^baserev" to git-diff-tree

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

 



Andy Parkins wrote:
> -                       echo "Diffstat:"
> -                       git-diff-tree --no-color --stat -M -C --find-copies-harder $newrev ^$baserev
> +                       echo "Diffstat against $baserev:"
> +                       git-diff-tree --no-color --stat -M -C --find-copies-harder $newrev $baserev

Shouldn't that be "... $baserev $newrev"? But read on.

I cannot entirely follow the reasoning of the comment above this part,
which says:

# Now the problem is for cases like this:
#   * --- * --- * --- * (oldrev)
#          \
#           * --- * --- * (newrev)
# i.e. there is no guarantee that newrev is a strict subset
# of oldrev - (would have required a force, but that's allowed).
# So, we can't simply say rev-list $oldrev..$newrev.  Instead
# we find the common base of the two revs and list from there

git rev-list $oldrev..$newrev

is exactly what you want in this case. The stunt with $baserev is not
necessary, and it may even be wrong if there is more than one
merge-base. $oldrev..$newrev will be correct even in this case.

You still need to derive a merge-base, but only to detect the forced
update and to format the message. Then you should use --not $baserev
instead of ^$baserev just in case there is more than one merge-base.

-- Hannes

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]