git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@osdl.org>
To: Martin Langhoff <martin.langhoff@gmail.com>
Cc: git <git@vger.kernel.org>, Junio C Hamano <junkio@cox.net>
Subject: Re: git-log --parents broken post v1.3.0
Date: Wed, 3 May 2006 07:59:00 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.64.0605030745550.4086@g5.osdl.org> (raw)
In-Reply-To: <46a038f90605030510x6d582804w6c0d2fec60bd56e5@mail.gmail.com>



On Thu, 4 May 2006, Martin Langhoff wrote:

> On 5/3/06, Martin Langhoff <martin.langhoff@gmail.com> wrote:
> > Soon after v1.3.0 git-log --parents got broken. When using --parents,
> 
> Ok -- perhaps that was a bit of a rushed statement. Reading back on
> the archives, it seems like it may have been intentional.

No it wasn't. "git log --parents" was definitely supposed to still work. 

That said, I suspect a git-cvsserver kind of usage is better off using 
"git-rev-list --parents HEAD" instead, which didn't break in the first 
place.

> I have to confess, I don't quite follow the changes happening in that
> series of commits. If --parents is really not coming back I'll change
> the log entry parsing in cvsserver. However, I suspect git-log should
> error out on it ("fatal: deprecated option") so porcelains break
> explicitly, rather than silently.

No, the option really isn't deprecated, it was just missed because nothing 
seemed to use it.. How about this diff?

Signed-off-by: Yadda yadda

		Linus

---
diff --git a/log-tree.c b/log-tree.c
index 9634c46..f9c6f7c 100644
--- a/log-tree.c
+++ b/log-tree.c
@@ -3,6 +3,15 @@ #include "diff.h"
 #include "commit.h"
 #include "log-tree.h"
 
+static void show_parents(struct commit *commit, int abbrev)
+{
+	struct commit_list *p;
+	for (p = commit->parents; p ; p = p->next) {
+		struct commit *parent = p->item;
+		printf(" %s", diff_unique_abbrev(parent->object.sha1, abbrev));
+	}
+}
+
 void show_log(struct rev_info *opt, struct log_info *log, const char *sep)
 {
 	static char this_header[16384];
@@ -14,7 +23,10 @@ void show_log(struct rev_info *opt, stru
 
 	opt->loginfo = NULL;
 	if (!opt->verbose_header) {
-		puts(sha1_to_hex(commit->object.sha1));
+		fputs(diff_unique_abbrev(commit->object.sha1, abbrev_commit), stdout);
+		if (opt->parents)
+			show_parents(commit, abbrev_commit);
+		putchar('\n');
 		return;
 	}
 
@@ -40,6 +52,8 @@ void show_log(struct rev_info *opt, stru
 	printf("%s%s",
 		opt->commit_format == CMIT_FMT_ONELINE ? "" : "commit ",
 		diff_unique_abbrev(commit->object.sha1, abbrev_commit));
+	if (opt->parents)
+		show_parents(commit, abbrev_commit);
 	if (parent) 
 		printf(" (from %s)", diff_unique_abbrev(parent->object.sha1, abbrev_commit));
 	putchar(opt->commit_format == CMIT_FMT_ONELINE ? ' ' : '\n');

  reply	other threads:[~2006-05-03 14:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-03 11:56 git-log --parents broken post v1.3.0 Martin Langhoff
2006-05-03 12:10 ` Martin Langhoff
2006-05-03 14:59   ` Linus Torvalds [this message]
2006-05-03 22:14     ` Martin Langhoff
2006-05-03 22:53     ` [PATCH] cvsserver: use git-rev-list instead of git-log Martin Langhoff

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=Pine.LNX.4.64.0605030745550.4086@g5.osdl.org \
    --to=torvalds@osdl.org \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    --cc=martin.langhoff@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).