git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
APAndy Parkins <andyparkins@gmail.com>
Date
Feb 13, 2007, 16:32 UTC
Message-ID
<200702131632.37401.andyparkins@gmail.com>
In-Reply-To
<45D1DB57.65433549@eudaptics.com>
On Tuesday 2007 February 13 15:37, Johannes Sixt wrote:
> Shouldn't that be "... $baserev $newrev"? But read on.
I think it should, yes.  Thanks.
Show 9 quoted lines
> #   * --- * --- * --- * (oldrev)
> #          \
> #           * --- * --- * (newrev)
>
> 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.

I just pinched the idea from the old update hook by Junio in 4f11b84c84. I just assumed that was the better way to do it. A quick test shows it to give the same output - I'm easy.

> 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.
Are you suggesting something like this?
git-rev-parse --not --all $baserev | git-rev-list --stdin --pretty $newrev

Which would start showing from $newrev but would exclude all baserevs and all existing branches.

Andy
-- 
Dr Andy Parkins, M Eng (hons), MIEE
andyparkins@gmail.com
Previous: Johannes SixtNext: Johannes Sixt
Message 3 of 6 in “diffstat generation in hooks--update was passing "^baserev" to git-diff-tree”
  1. 3/3 diffstat generation in hooks--update was passing "^baserev" to git-diff-treeAndy Parkins, Feb 13, 2007
  2. Johannes SixtFeb 13, 2007
  3. Andy ParkinsFeb 13, 2007
  4. Johannes SixtFeb 13, 2007
  5. Linus TorvaldsFeb 13, 2007
  6. Andy ParkinsFeb 13, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.