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

[PATCH] Remove use of git-rev-parse and replace git-rev-list --pretty with git-log

From
APAndy Parkins <andyparkins@gmail.com>
Date
Mar 2, 2007, 19:29 UTC
Message-ID
<200703021929.20969.andyparkins@gmail.com>
In-Reply-To
<Pine.LNX.4.64.0703020839350.3953@woody.linux-foundation.org>
Linus noticed:

--- >8 --- it should just avoid git-rev-parse these days and do

  git rev-list --pretty $newrev --not --all

instead. And quite frankly, rather than "git rev-list --pretty", there's no real reason not to do

  git log $newrev --not --all
--- 8< ---
This patch makes those changes.
Signed-off-by: Andy Parkins <andyparkins@gmail.com>
---
 templates/hooks--update |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/templates/hooks--update b/templates/hooks--update
index 2a707e5..f580360 100644
--- a/templates/hooks--update
+++ b/templates/hooks--update
@@ -148,7 +148,7 @@ case "$refname_type" in
 			# This shows all log entries that are not already covered by
 			# another ref - i.e. commits that are now accessible from this
 			# ref that were previously not accessible
-			git-rev-parse --not --all | git-rev-list --stdin --pretty $newrev
+			git log $newrev --not --all
 			echo $LOGEND
 		else
 			# oldrev is valid
@@ -165,7 +165,7 @@ case "$refname_type" in
 			baserev=$(git-merge-base $oldrev $newrev)
 
 			# Commit with a parent
-			for rev in $(git-rev-parse --not --all | git-rev-list --stdin $newrev ^$baserev)
+			for rev in $(git-rev-list $newrev ^$baserev --not --all)
 			do
 				revtype=$(git-cat-file -t "$rev")
 				echo "       via  $rev ($revtype)"
@@ -190,8 +190,7 @@ case "$refname_type" in
 			fi
 			echo ""
 			echo $LOGBEGIN
-			git-rev-parse --not --all |
-			git-rev-list --stdin --pretty $newrev ^$baserev
+			git log $newrev ^$baserev --not --all
 			echo $LOGEND
 			echo ""
 			echo "Diffstat:"
-- 
1.5.0.rc4.gb4d2
Previous: Andy ParkinsNext: Linus Torvalds
Message 4 of 9 in “Fix typo on variable name $newref should be $newrev in sample update hook”
  1. Fix typo on variable name $newref should be $newrev in sample update hookAndy Parkins, Mar 2, 2007
  2. Linus TorvaldsMar 2, 2007
  3. Andy ParkinsMar 2, 2007
  4. Remove use of git-rev-parse and replace git-rev-list --pretty with git-logAndy Parkins, Mar 2, 2007
  5. Linus TorvaldsMar 2, 2007
  6. Junio C HamanoMar 2, 2007
  7. Andy ParkinsMar 3, 2007
  8. Junio C HamanoMar 3, 2007
  9. Linus TorvaldsMar 4, 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.