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

[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, 14:24 UTC
Message-ID
<200702131424.21665.andyparkins@gmail.com>

For generating the diffstat after a branch update, git-diff-tree is simply comparing the new revision with the base revision. However, the baserev was being passed with a "^" operator proceeding it - this (I think) made git-diff-tree think that a path was being specified for comparison rather than a second path, so only a single revision was being summarised.

Signed-off-by: Andy Parkins <andyparkins@gmail.com>
---
 templates/hooks--update |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/templates/hooks--update b/templates/hooks--update
index 7e8258a..ee3859c 100644
--- a/templates/hooks--update
+++ b/templates/hooks--update
@@ -193,8 +193,8 @@ case "$refname_type" in
 			git-rev-parse --not --all | git-rev-list --stdin --pretty $newrev ^$baserev
 			echo $LOGEND
 			echo ""
-			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
 		fi
 		;;
 	"annotated tag")
-- 
1.5.0.rc4.364.g85b1
Next: Johannes Sixt
Message 1 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.