All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Sixt <J.Sixt@eudaptics.com>
To: git@vger.kernel.org
Subject: Re: [PATCH 3/3] diffstat generation in hooks--update was passing  "^baserev" to git-diff-tree
Date: Tue, 13 Feb 2007 16:37:59 +0100	[thread overview]
Message-ID: <45D1DB57.65433549@eudaptics.com> (raw)
In-Reply-To: 200702131424.21665.andyparkins@gmail.com

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

  reply	other threads:[~2007-02-13 15:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-13 14:24 [PATCH 3/3] diffstat generation in hooks--update was passing "^baserev" to git-diff-tree Andy Parkins
2007-02-13 15:37 ` Johannes Sixt [this message]
2007-02-13 16:32   ` Andy Parkins
2007-02-13 17:16     ` Johannes Sixt
2007-02-13 17:03 ` Linus Torvalds
2007-02-13 18:34   ` Andy Parkins

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=45D1DB57.65433549@eudaptics.com \
    --to=j.sixt@eudaptics.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.