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

Re: cg-log patches

From
Jonas Fonseca <fonseca@diku.dk>
Date
May 8, 2005, 23:49 UTC
Message-ID
<20050508234936.GA26624@diku.dk>
In-Reply-To
<1742.10.10.10.24.1115573750.squirrel@linux1>
Sean <seanlkml@sympatico.ca> wrote Sun, May 08, 2005:
> commit 33762f33ee87377c0cfcea51382bad04d7c9ba8d
> 
>     Fix cg-log -f option so that a complete list of files is
>     displayed when a commit has more than one parent.
This sounds great.
>     Move the list of files so they're displayed after the
>     commit message

The reason I put it at the top was to make it more similar to GNU-style changelogs (if there is such a style).

>     List the files in columns, instead of one big line of comma-
>     separated files.
I think that will make `-f' less usable because of the extra scrolling.

Assuming use of wc will not create more dependency nightmares and the extra overhead is acceptable here is a patch that will wrap file listing lines near the 80th column.

Signed-off-by: Jonas Fonseca <fonseca@diku.dk>

--- d4119364a7fbf5a4b8f00f061e4f5d58fa4abd0e/cg-log (mode:100755) +++ uncommitted/cg-log (mode:100755)

@@ -64,8 +64,16 @@
 	fi
 	echo
 	$list_cmd | while read modes type sha1s file; do
-		echo -n "$sep$file"
+		echo -n "$sep"
 		sep=", "
+		if [ $(echo "$line$sep$file" | wc -c) -lt 75 ]; then
+			line="$line$sep$file"
+			echo -n "$file"
+		else
+			line="$file"
+			echo "$coldefault"
+			echo -n "    $colfiles$file"
+		fi
 	done
 	echo "$coldefault:"
 }
-- 
Jonas Fonseca
Previous: Marcel HoltmannNext: Sean
Message 10 of 17 in “cg-log patches”
  1. SeanMay 8, 2005
  2. Marcel HoltmannMay 8, 2005
  3. SeanMay 8, 2005
  4. Marcel HoltmannMay 8, 2005
  5. Petr BaudisMay 8, 2005
  6. SeanMay 8, 2005
  7. Petr BaudisMay 8, 2005
  8. SeanMay 8, 2005
  9. Marcel HoltmannMay 8, 2005
  10. Jonas FonsecaMay 8, 2005
  11. SeanMay 9, 2005
  12. Jonas FonsecaMay 9, 2005
  13. Petr BaudisMay 9, 2005
  14. Jonas FonsecaMay 9, 2005
  15. SeanMay 9, 2005
  16. Petr BaudisMay 10, 2005
  17. Petr BaudisMay 8, 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.