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

[PATCH] cg-log: make -r id:id show the given id instead of nothing

From
Jonas Fonseca <fonseca@diku.dk>
Date
May 20, 2005, 15:04 UTC
Message-ID
<20050520150400.GC27395@diku.dk>

If cg-log is passed -r cogito-0.10 -r cogito-0.10 no log entries are shown. This patch make it show the log for the given ID.

Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Index: cg-log
===================================================================
--- ca5fef50fb68a3afbb35e1a48ac622f7a964f021/cg-log  (mode:100755)
+++ uncommitted/cg-log  (mode:100755)
@@ -113,6 +113,9 @@
 if [ "$log_end" ]; then
 	id1="$(commit-id $log_start)" || exit 1
 	id2="$(commit-id $log_end)" || exit 1
+	if [ "$id1" = "$id2" ]; then
+		id1=$(git-cat-file commit $id1 | sed -n '/^parent /,0s/parent //p')
+	fi
 	revls="git-rev-tree $id2 ^$id1"
 	revsort="sort -rn"
 	revfmt="git-rev-tree"
-- 
Jonas Fonseca
Next: Petr Baudis
Message 1 of 3 in “cg-log: make -r id:id show the given id instead of nothing”
  1. cg-log: make -r id:id show the given id instead of nothingJonas Fonseca, May 20, 2005
  2. Petr BaudisMay 29, 2005
  3. Jonas FonsecaMay 29, 2005

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.