summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ea4f2bd)
raw | patch | inline | side by side (parent: ea4f2bd)
author | Linus Torvalds <torvalds@linux-foundation.org> | |
Sat, 15 Nov 2008 18:02:01 +0000 (10:02 -0800) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sun, 16 Nov 2008 08:24:41 +0000 (00:24 -0800) |
The space between the commit and the source attribute is not easily
machine-parseable: if we combine --source with --parents and give a SHA1
as a starting point, it's unnecessarily hard to see where the list of
parents ends and the source decoration begins.
Example:
git show --parents --source $(git rev-list HEAD)
which is admittedly contrived, but can easily happen in scripting.
So use a <tab> instead of a space as the source separator.
The other decorations didn't have this issue, because they were surrounded
by parenthesis, so it's obvious that they aren't parent SHA1's.
It so happens that _visually_ this makes no difference for "git log
--source", since "commit <40-char SHA1>" is 47 characters, so both a space
and a <tab> will end up showing as a single commit. Of course, with
'--pretty=oneline' or '--parents' or '--abbrev-commit' you'll see the
difference.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
machine-parseable: if we combine --source with --parents and give a SHA1
as a starting point, it's unnecessarily hard to see where the list of
parents ends and the source decoration begins.
Example:
git show --parents --source $(git rev-list HEAD)
which is admittedly contrived, but can easily happen in scripting.
So use a <tab> instead of a space as the source separator.
The other decorations didn't have this issue, because they were surrounded
by parenthesis, so it's obvious that they aren't parent SHA1's.
It so happens that _visually_ this makes no difference for "git log
--source", since "commit <40-char SHA1>" is 47 characters, so both a space
and a <tab> will end up showing as a single commit. Of course, with
'--pretty=oneline' or '--parents' or '--abbrev-commit' you'll see the
difference.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
log-tree.c | patch | blob | history |
diff --git a/log-tree.c b/log-tree.c
index 5444f0860b2150d440dfbd5a4be4aa2daa1316fc..194ddb13da09668334cd9e1f6eeef517c3346ee9 100644 (file)
--- a/log-tree.c
+++ b/log-tree.c
struct name_decoration *decoration;
if (opt->show_source && commit->util)
- printf(" %s", (char *) commit->util);
+ printf("\t%s", (char *) commit->util);
if (!opt->show_decorations)
return;
decoration = lookup_decoration(&name_decoration, &commit->object);