All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonas Fonseca <fonseca@diku.dk>
To: Sean <seanlkml@sympatico.ca>
Cc: Petr Baudis <pasky@ucw.cz>, GIT Mailing List <git@vger.kernel.org>
Subject: Re: cg-log patches
Date: Mon, 9 May 2005 13:39:07 +0200	[thread overview]
Message-ID: <20050509113907.GA22830@diku.dk> (raw)
In-Reply-To: <4302.10.10.10.24.1115610350.squirrel@linux1>

[-- Attachment #1: Type: text/plain, Size: 844 bytes --]

Sean <seanlkml@sympatico.ca> wrote Sun, May 08, 2005:
> On Sun, May 8, 2005 7:49 pm, Jonas Fonseca said:
> Hey Jonas,

Hi Sean,

> >>     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.
> 
> You might want to rip it out and submit it, because it's not likely to see
> the light of day otherwise.

I ripped it out and made a patch only with the fix.

Pasky, I also updated the line-wrapping patch if you want it.

> > The reason I put it at the top was to make it more similar to GNU-style
> > changelogs (if there is such a style).
> 
> Yeah, I felt a bit guilty sliding that shift in, really I had no rationale
> other than it looked better _to me_.

I don't feel strong about it. I guess I have just gotten used to it that
way.

-- 
Jonas Fonseca

[-- Attachment #2: fix-cg-log.patch --]
[-- Type: text/plain, Size: 2218 bytes --]

Fix cg-log -f option so that a complete list of files is
displayed when a commit has more than one parent.

Signed-off-by: Sean Estabrooks <seanlkml@sympatico.ca>
Signed-off-by: Jonas Fonseca <fonseca@diku.dk>

---
commit 06a6b40f8e52eff0e34706c7024b54df50abb6b9
tree 95bc73fd188347aa294991d1c5c7cffd60422098
parent 4ed293bc0a5ffca9683e139cad499b69a4c4d569
author jonas <fonseca@diku.dk> Mon, 09 May 2005 13:23:20 +0200
committer jonas <fonseca@diku.dk> Mon, 09 May 2005 13:23:20 +0200

 cg-log |   34 +++++++++++++++-------------------
 1 files changed, 15 insertions(+), 19 deletions(-)

Index: cg-log
===================================================================
--- 00b94eea5b99d5dd1d1bbe9c9ca3502d11aec581/cg-log  (mode:100755)
+++ 95bc73fd188347aa294991d1c5c7cffd60422098/cg-log  (mode:100755)
@@ -53,17 +53,20 @@
 
 list_commit_files()
 {
-	tree1="$1"
-	tree2="$2"
+	tree="$1"
 	sep="    * $colfiles"
-	# List all files for for the initial commit
-	if [ -z $tree2 ]; then
-		list_cmd="git-ls-tree $tree1"
-	else
-		list_cmd="git-diff-tree -r $tree1 $tree2"
-	fi
 	echo
-	$list_cmd | while read modes type sha1s file; do
+	if [ -z $2 ]; then
+		# List all files for the initial commit
+		git-ls-tree $tree
+	else
+		shift
+		# List changes from each parent
+		for parent; do
+			git-diff-tree -r $tree $parent
+		done
+	fi | sort -u | \
+	while read modes type sha1s file; do
 		echo -n "$sep$file"
 		sep=", "
 	done
@@ -102,8 +105,7 @@
 
 $revls | $revsort | while read time commit parents; do
 	trap exit SIGPIPE
-	tree1=
-	tree2=
+	trees=
 	[ "$revfmt" = "git-rev-list" ] && commit="$time"
 	if [ $# -ne 0 ]; then
 		parent=$(git-cat-file commit $commit | sed -n '2s/parent //p;2Q')
@@ -131,17 +133,11 @@
 				fi
 				;;
 			"tree"|"parent")
-				if [ -z $tree1 ]; then
-					tree1=$rest
-				elif [ -z $tree2 ]; then
-					tree2=$rest
-				fi
+				trees="$trees $rest"
 				echo $colheader$key $rest $coldefault
 				;;
 			"")
-				if [ -n "$list_files" ]; then
-					list_commit_files "$tree1" "$tree2"
-				fi
+				[ -n "$list_files" ] && list_commit_files $trees
 				echo; sed -re '
 					/ *Signed-off-by:.*/Is//'$colsignoff'&'$coldefault'/
 					/ *Acked-by:.*/Is//'$colsignoff'&'$coldefault'/

[-- Attachment #3: wrap-file-listing-lines.patch --]
[-- Type: text/plain, Size: 1030 bytes --]

Wrap file listing lines near the 80th column.

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

---
commit 9d86f44f7d1eee525ed4c45731ad07b95f62dbb6
tree ddf82a0140bdc1440eb93bcbe01e14e90e44a3e8
parent 06a6b40f8e52eff0e34706c7024b54df50abb6b9
author jonas <fonseca@diku.dk> Mon, 09 May 2005 13:27:20 +0200
committer jonas <fonseca@diku.dk> Mon, 09 May 2005 13:27:20 +0200

 cg-log |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletion(-)

Index: cg-log
===================================================================
--- 95bc73fd188347aa294991d1c5c7cffd60422098/cg-log  (mode:100755)
+++ ddf82a0140bdc1440eb93bcbe01e14e90e44a3e8/cg-log  (mode:100755)
@@ -67,8 +67,16 @@
 		done
 	fi | sort -u | \
 	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:"
 }

  reply	other threads:[~2005-05-09 11:32 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-08 17:35 cg-log patches Sean
2005-05-08 17:42 ` Marcel Holtmann
2005-05-08 18:26   ` Sean
2005-05-08 19:00     ` Marcel Holtmann
2005-05-08 19:18       ` Petr Baudis
2005-05-08 19:23         ` Sean
2005-05-08 19:25           ` Petr Baudis
2005-05-08 19:52             ` Sean
2005-05-08 19:27         ` Marcel Holtmann
     [not found] ` <1792.10.10.10.24.1115575196.squirrel@linux1>
     [not found]   ` <20050508180312.GB9495@pasky.ji.cz>
     [not found]     ` <1896.10.10.10.24.1115577733.squirrel@linux1>
2005-05-08 19:01       ` Petr Baudis
2005-05-08 23:49 ` Jonas Fonseca
2005-05-09  3:45   ` Sean
2005-05-09 11:39     ` Jonas Fonseca [this message]
2005-05-09 12:14       ` Petr Baudis
2005-05-09 12:41         ` Jonas Fonseca
2005-05-09 13:13         ` Sean
2005-05-10  0:37         ` Petr Baudis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050509113907.GA22830@diku.dk \
    --to=fonseca@diku.dk \
    --cc=git@vger.kernel.org \
    --cc=pasky@ucw.cz \
    --cc=seanlkml@sympatico.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.