Git development
 help / color / mirror / Atom feed
* Simplify '--prett=xyz' options
@ 2009-08-15 19:01 Linus Torvalds
  2009-08-15 19:19 ` Thomas Rast
  2009-08-15 20:22 ` Johannes Schindelin
  0 siblings, 2 replies; 9+ messages in thread
From: Linus Torvalds @ 2009-08-15 19:01 UTC (permalink / raw)
  To: Junio C Hamano, Git Mailing List


I keep on thinking that I can write

	git log --format:'%aN: %s'

instead of using the long-form "--pretty=format:xyz' thing. And each time, 
I curse myself for being stupid for forgetting the proper format.

And I'm tired of being stupid. So this patch makes me smart and 
forward-thinking instead.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
---

Now I just need a patch to make me athletic and handsome.

 commit.h   |    1 +
 pretty.c   |   26 ++++++++++++++++----------
 revision.c |    2 ++
 3 files changed, 19 insertions(+), 10 deletions(-)

diff --git a/commit.h b/commit.h
index ba9f638..cc4229b 100644
--- a/commit.h
+++ b/commit.h
@@ -68,6 +68,7 @@ struct rev_info; /* in revision.h, it circularly uses enum cmit_fmt */
 extern char *reencode_commit_message(const struct commit *commit,
 				     const char **encoding_p);
 extern void get_commit_format(const char *arg, struct rev_info *);
+extern int try_get_commit_format(const char *arg, struct rev_info *);
 extern void format_commit_message(const struct commit *commit,
 				  const void *format, struct strbuf *sb,
 				  enum date_mode dmode);
diff --git a/pretty.c b/pretty.c
index e5328da..97d36c5 100644
--- a/pretty.c
+++ b/pretty.c
@@ -19,7 +19,7 @@ static void save_user_format(struct rev_info *rev, const char *cp, int is_tforma
 	rev->commit_format = CMIT_FMT_USERFORMAT;
 }
 
-void get_commit_format(const char *arg, struct rev_info *rev)
+int try_get_commit_format(const char *arg, struct rev_info *rev)
 {
 	int i;
 	static struct cmt_fmt_map {
@@ -36,14 +36,9 @@ void get_commit_format(const char *arg, struct rev_info *rev)
 		{ "oneline",	1,	CMIT_FMT_ONELINE },
 	};
 
-	rev->use_terminator = 0;
-	if (!arg || !*arg) {
-		rev->commit_format = CMIT_FMT_DEFAULT;
-		return;
-	}
 	if (!prefixcmp(arg, "format:") || !prefixcmp(arg, "tformat:")) {
 		save_user_format(rev, strchr(arg, ':') + 1, arg[0] == 't');
-		return;
+		return 1;
 	}
 	for (i = 0; i < ARRAY_SIZE(cmt_fmts); i++) {
 		if (!strncmp(arg, cmt_fmts[i].n, cmt_fmts[i].cmp_len) &&
@@ -51,15 +46,26 @@ void get_commit_format(const char *arg, struct rev_info *rev)
 			if (cmt_fmts[i].v == CMIT_FMT_ONELINE)
 				rev->use_terminator = 1;
 			rev->commit_format = cmt_fmts[i].v;
-			return;
+			return 1;
 		}
 	}
 	if (strchr(arg, '%')) {
 		save_user_format(rev, arg, 1);
-		return;
+		return 1;
 	}
 
-	die("invalid --pretty format: %s", arg);
+	return 0;
+}
+
+void get_commit_format(const char *arg, struct rev_info *rev)
+{
+	rev->use_terminator = 0;
+	if (!arg || !*arg) {
+		rev->commit_format = CMIT_FMT_DEFAULT;
+		return;
+	}
+	if (!try_get_commit_format(arg, rev))
+		die("invalid --pretty format: %s", arg);
 }
 
 /*
diff --git a/revision.c b/revision.c
index 9f5dac5..181593f 100644
--- a/revision.c
+++ b/revision.c
@@ -1192,6 +1192,8 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg
 	} else if (!strcmp(arg, "--children")) {
 		revs->children.name = "children";
 		revs->limited = 1;
+	} else if (!strncmp(arg, "--", 2) && try_get_commit_format(arg+2, revs)) {
+		revs->verbose_header = 1;
 	} else {
 		int opts = diff_opt_parse(&revs->diffopt, argv, argc);
 		if (!opts)

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: Simplify '--prett=xyz' options
  2009-08-15 19:01 Simplify '--prett=xyz' options Linus Torvalds
@ 2009-08-15 19:19 ` Thomas Rast
  2009-08-15 19:50   ` Linus Torvalds
  2009-08-15 20:22 ` Johannes Schindelin
  1 sibling, 1 reply; 9+ messages in thread
From: Thomas Rast @ 2009-08-15 19:19 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Junio C Hamano, Git Mailing List

Linus Torvalds wrote:
> 
> I keep on thinking that I can write
> 
> 	git log --format:'%aN: %s'
> 
> instead of using the long-form "--pretty=format:xyz' thing. And each time, 
> I curse myself for being stupid for forgetting the proper format.
> 
> And I'm tired of being stupid. So this patch makes me smart and 
> forward-thinking instead.

But we already have --format="%aN: %s" since these two commits:

commit 36407548a2825462a91b456755412a65fd611fc0
Author: Nanako Shiraishi <nanako3@lavabit.com>
Date:   Tue Feb 24 18:59:15 2009 +0900

    Give short-hands to --pretty=tformat:%formatstring

    Allow --pretty="%h %s" (and --format="%h %s") as shorthand for an often
    used option --pretty=tformat:"%h %s".

    Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>

commit 3a4c1a5e212357c3df030b6713c75466694c2e77
Author: Nanako Shiraishi <nanako3@lavabit.com>
Date:   Tue Feb 24 18:59:14 2009 +0900

    Add --format that is a synonym to --pretty

    Some people prefer to call the pretty-print styles "format", and get
    annoyed to see "git log --format=short" fail.  Introduce it as a synonym
    to --pretty so that both can be used.

    Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>


Granted, it makes it equivalent to --pretty=tformat:foo, but isn't
tformat the better choice in many cases?

-- 
Thomas Rast
trast@{inf,student}.ethz.ch

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Simplify '--prett=xyz' options
  2009-08-15 19:19 ` Thomas Rast
@ 2009-08-15 19:50   ` Linus Torvalds
  2009-08-15 20:16     ` Junio C Hamano
  2009-08-15 21:39     ` Linus Torvalds
  0 siblings, 2 replies; 9+ messages in thread
From: Linus Torvalds @ 2009-08-15 19:50 UTC (permalink / raw)
  To: Thomas Rast; +Cc: Junio C Hamano, Git Mailing List



On Sat, 15 Aug 2009, Thomas Rast wrote:
> 
> But we already have --format="%aN: %s" since these two commits:

Yeah. Junio pointed that out.

We also have --oneline, which I actually like (but it doesn't work like 
--pretty=oneline - it also enables --abbrev-commit). But then we don't 
have --fuller (which is what I usually want to use when I want to see 
committer info).

And "format" takes ':' when with --pretty=, but '=' when alone. Which is 
what made me not notice that it worked due to silly semantic changes.And 
the confusion with tformat vs format is fundamental.

> Granted, it makes it equivalent to --pretty=tformat:foo, but isn't
> tformat the better choice in many cases?

Not really. Look at what happens with

	git log --stat --pretty=format:%s

and then try tformat instead. 'tformat' is broken, as is our current 
--format=%s.

In other words, all of that crud is totally illogical, and our "short 
versions" (--oneline and --format=) were done entirely incorrectly (well, 
--oneline probably has the _right_ semantics, and --pretty=oneline is just 
wrong, but whatever).

Sadly, we can't fix those things well.

But here's a fixed version of my patch that gets rid of some problems.

And our current --format= thing really _is_ fundamentaly broken, as shown 
by my example above. Making it work like 'tformat' was a bug. With this, 
you can say

	git log --tformat=%s

if you want the stupid tformat semantics.

[ Junio, I fixed that, so this is strictly "version 3" of the patch. Now 
  "--format=x" works like "--pretty=format:x" and if you want tformat 
  semantics, you need to say "--tformat=x")

  That's why the test-cases got modified with this patch - we were 
  actually _testing_ for that idiotic behavior of --pretty=format:x being 
  different from --format=x ]

I would like to also make "--pretty=oneline" have the same abbrev-commit 
semantics as "--oneline" has, but I didn't actually do that change.

		Linus

---
 commit.h       |    1 +
 pretty.c       |   42 +++++++++++++++++++++++++++++-------------
 revision.c     |    9 +++++++--
 t/t4202-log.sh |   14 +++++++-------
 4 files changed, 44 insertions(+), 22 deletions(-)

diff --git a/commit.h b/commit.h
index ba9f638..cc4229b 100644
--- a/commit.h
+++ b/commit.h
@@ -68,6 +68,7 @@ struct rev_info; /* in revision.h, it circularly uses enum cmit_fmt */
 extern char *reencode_commit_message(const struct commit *commit,
 				     const char **encoding_p);
 extern void get_commit_format(const char *arg, struct rev_info *);
+extern int try_get_commit_format(const char *arg, struct rev_info *);
 extern void format_commit_message(const struct commit *commit,
 				  const void *format, struct strbuf *sb,
 				  enum date_mode dmode);
diff --git a/pretty.c b/pretty.c
index e5328da..1a76320 100644
--- a/pretty.c
+++ b/pretty.c
@@ -19,7 +19,7 @@ static void save_user_format(struct rev_info *rev, const char *cp, int is_tforma
 	rev->commit_format = CMIT_FMT_USERFORMAT;
 }
 
-void get_commit_format(const char *arg, struct rev_info *rev)
+int try_get_commit_format(const char *arg, struct rev_info *rev)
 {
 	int i;
 	static struct cmt_fmt_map {
@@ -36,30 +36,46 @@ void get_commit_format(const char *arg, struct rev_info *rev)
 		{ "oneline",	1,	CMIT_FMT_ONELINE },
 	};
 
-	rev->use_terminator = 0;
-	if (!arg || !*arg) {
-		rev->commit_format = CMIT_FMT_DEFAULT;
-		return;
+	if (!prefixcmp(arg, "format")) {
+		if (arg[6] == ':' || arg[6] == '=') {
+			save_user_format(rev, arg+7, 0);
+			return 1;
+		}
 	}
-	if (!prefixcmp(arg, "format:") || !prefixcmp(arg, "tformat:")) {
-		save_user_format(rev, strchr(arg, ':') + 1, arg[0] == 't');
-		return;
+	if (!prefixcmp(arg, "tformat")) {
+		if (arg[7] == ':' || arg[7] == '=') {
+			save_user_format(rev, arg+8, 1);
+			return 1;
+		}
 	}
+
 	for (i = 0; i < ARRAY_SIZE(cmt_fmts); i++) {
 		if (!strncmp(arg, cmt_fmts[i].n, cmt_fmts[i].cmp_len) &&
 		    !strncmp(arg, cmt_fmts[i].n, strlen(arg))) {
 			if (cmt_fmts[i].v == CMIT_FMT_ONELINE)
 				rev->use_terminator = 1;
 			rev->commit_format = cmt_fmts[i].v;
-			return;
+			return 1;
 		}
 	}
-	if (strchr(arg, '%')) {
-		save_user_format(rev, arg, 1);
+
+	return 0;
+}
+
+void get_commit_format(const char *arg, struct rev_info *rev)
+{
+	rev->use_terminator = 0;
+	if (!arg || !*arg) {
+		rev->commit_format = CMIT_FMT_DEFAULT;
 		return;
 	}
-
-	die("invalid --pretty format: %s", arg);
+	if (!try_get_commit_format(arg, rev)) {
+		if (strchr(arg, '%')) {
+			save_user_format(rev, arg, 0);
+			return;
+		}
+		die("invalid --pretty format: %s", arg);
+	}
 }
 
 /*
diff --git a/revision.c b/revision.c
index 9f5dac5..bdace8b 100644
--- a/revision.c
+++ b/revision.c
@@ -1123,7 +1123,7 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg
 	} else if (!strcmp(arg, "--pretty")) {
 		revs->verbose_header = 1;
 		get_commit_format(arg+8, revs);
-	} else if (!prefixcmp(arg, "--pretty=") || !prefixcmp(arg, "--format=")) {
+	} else if (!prefixcmp(arg, "--pretty=")) {
 		revs->verbose_header = 1;
 		get_commit_format(arg+9, revs);
 	} else if (!strcmp(arg, "--oneline")) {
@@ -1194,8 +1194,13 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg
 		revs->limited = 1;
 	} else {
 		int opts = diff_opt_parse(&revs->diffopt, argv, argc);
-		if (!opts)
+		if (!opts) {
+			if (!strncmp(arg, "--", 2) && try_get_commit_format(arg+2, revs)) {
+				revs->verbose_header = 1;
+				return 1;
+			}
 			unkv[(*unkc)++] = arg;
+		}
 		return opts;
 	}
 
diff --git a/t/t4202-log.sh b/t/t4202-log.sh
index 48e0088..2f1a5a5 100755
--- a/t/t4202-log.sh
+++ b/t/t4202-log.sh
@@ -44,13 +44,6 @@ test_expect_success 'pretty' '
 	test_cmp expect actual
 '
 
-printf "sixth\nfifth\nfourth\nthird\nsecond\ninitial\n" > expect
-test_expect_success 'pretty (tformat)' '
-
-	git log --pretty="tformat:%s" > actual &&
-	test_cmp expect actual
-'
-
 test_expect_success 'pretty (shortcut)' '
 
 	git log --pretty="%s" > actual &&
@@ -63,6 +56,13 @@ test_expect_success 'format' '
 	test_cmp expect actual
 '
 
+printf "sixth\nfifth\nfourth\nthird\nsecond\ninitial\n" > expect
+test_expect_success 'pretty (tformat)' '
+
+	git log --pretty="tformat:%s" > actual &&
+	test_cmp expect actual
+'
+
 cat > expect << EOF
 804a787 sixth
 394ef78 fifth

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: Simplify '--prett=xyz' options
  2009-08-15 19:50   ` Linus Torvalds
@ 2009-08-15 20:16     ` Junio C Hamano
  2009-08-15 20:36       ` Linus Torvalds
  2009-08-15 21:39     ` Linus Torvalds
  1 sibling, 1 reply; 9+ messages in thread
From: Junio C Hamano @ 2009-08-15 20:16 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Thomas Rast, Git Mailing List

Linus Torvalds <torvalds@linux-foundation.org> writes:

> On Sat, 15 Aug 2009, Thomas Rast wrote:
>
>> Granted, it makes it equivalent to --pretty=tformat:foo, but isn't
>> tformat the better choice in many cases?
>
> Not really. Look at what happens with
>
> 	git log --stat --pretty=format:%s
>
> and then try tformat instead. 'tformat' is broken, as is our current 
> --format=%s.
>
> In other words, all of that crud is totally illogical, and our "short 
> versions" (--oneline and --format=) were done entirely incorrectly (well, 
> --oneline probably has the _right_ semantics, and --pretty=oneline is just 
> wrong, but whatever).

If you try that without --stat, i.e.

    $ git log -4 --pretty=format:%s | cat -e
    $ git log -4 --pretty=tformat:%s | cat -e

I suspect you may then find that --pretty=format (not --pretty=tformat) is
broken.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Simplify '--prett=xyz' options
  2009-08-15 19:01 Simplify '--prett=xyz' options Linus Torvalds
  2009-08-15 19:19 ` Thomas Rast
@ 2009-08-15 20:22 ` Johannes Schindelin
  1 sibling, 0 replies; 9+ messages in thread
From: Johannes Schindelin @ 2009-08-15 20:22 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Junio C Hamano, Git Mailing List

Hi,

On Sat, 15 Aug 2009, Linus Torvalds wrote:

> 
> I keep on thinking that I can write
> 
> 	git log --format:'%aN: %s'

You mean as opposed to "--format=%aN:\ %s" (which works)?

> Now I just need a patch to make me athletic and handsome.

I thought that already happened?  /me remembers seeing a youtube video 
with you in speedos.


> diff --git a/revision.c b/revision.c
> index 9f5dac5..181593f 100644
> --- a/revision.c
> +++ b/revision.c
> @@ -1192,6 +1192,8 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg
>  	} else if (!strcmp(arg, "--children")) {
>  		revs->children.name = "children";
>  		revs->limited = 1;
> +	} else if (!strncmp(arg, "--", 2) && try_get_commit_format(arg+2, revs)) {

prefixcmp?

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Simplify '--prett=xyz' options
  2009-08-15 20:16     ` Junio C Hamano
@ 2009-08-15 20:36       ` Linus Torvalds
  2009-08-15 21:05         ` Avery Pennarun
  0 siblings, 1 reply; 9+ messages in thread
From: Linus Torvalds @ 2009-08-15 20:36 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Thomas Rast, Git Mailing List



On Sat, 15 Aug 2009, Junio C Hamano wrote:
> 
> If you try that without --stat, i.e.
> 
>     $ git log -4 --pretty=format:%s | cat -e
>     $ git log -4 --pretty=tformat:%s | cat -e
> 
> I suspect you may then find that --pretty=format (not --pretty=tformat) is
> broken.

I disagree. The real brokenness is that we don't have any way to say "I 
want no newline at all after the format", and then having this mixup with 
the whole "terminator" thing - sometimes it's "between commits" (which is 
_correct_ any time you have stat info or something), and sometimes it's 
"after header" (which is almost always incorrect).

For an example of this, try to do a one-line format that shows the 
diffstat on the same line. IOW, what you really want is something like

	git log -4 --shortstat --format=%s%NOTERM

but you can't do it at all right now - and defaulting to the "tformat" 
thing is actually _worse_.

So I do agree that "format" is broken and confused. I just think that 
"tformat" is EVEN MORE broken and confused, it just happens to fix that 
one form of brokenness that "format" has.

Notice how "CMIT_FMT_ONELINE" use the "use_terminator" (like tformat), but 
then does things right (unlike tformat). In particular, it's this one:

        pp_header(fmt, abbrev, dmode, encoding, commit, &msg, sb);
        if (fmt != CMIT_FMT_ONELINE && !subject) {
                strbuf_addch(sb, '\n');
        }       
	..
        /* Make sure there is an EOLN for the non-oneline case */
        if (fmt != CMIT_FMT_ONELINE)
                strbuf_addch(sb, '\n');

and notice how we have no way to edit those from the "format" descriptors.

			Linus

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Simplify '--prett=xyz' options
  2009-08-15 20:36       ` Linus Torvalds
@ 2009-08-15 21:05         ` Avery Pennarun
  2009-08-15 21:29           ` Linus Torvalds
  0 siblings, 1 reply; 9+ messages in thread
From: Avery Pennarun @ 2009-08-15 21:05 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Junio C Hamano, Thomas Rast, Git Mailing List

On Sat, Aug 15, 2009 at 4:36 PM, Linus
Torvalds<torvalds@linux-foundation.org> wrote:
> On Sat, 15 Aug 2009, Junio C Hamano wrote:
>> If you try that without --stat, i.e.
>>
>>     $ git log -4 --pretty=format:%s | cat -e
>>     $ git log -4 --pretty=tformat:%s | cat -e
>>
>> I suspect you may then find that --pretty=format (not --pretty=tformat) is
>> broken.
>
> I disagree. The real brokenness is that we don't have any way to say "I
> want no newline at all after the format", and then having this mixup with
> the whole "terminator" thing - sometimes it's "between commits" (which is
> _correct_ any time you have stat info or something), and sometimes it's
> "after header" (which is almost always incorrect).

I'm guessing that "after header" was just an implementation error.  It
was presumably intended to be "after commit", so that the only
difference between format and tformat is the presence or absence of
the very last terminator.

Maybe the correct fix is just to make tformat not broken?

Avery

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Simplify '--prett=xyz' options
  2009-08-15 21:05         ` Avery Pennarun
@ 2009-08-15 21:29           ` Linus Torvalds
  0 siblings, 0 replies; 9+ messages in thread
From: Linus Torvalds @ 2009-08-15 21:29 UTC (permalink / raw)
  To: Avery Pennarun; +Cc: Junio C Hamano, Thomas Rast, Git Mailing List



On Sat, 15 Aug 2009, Avery Pennarun wrote:
> 
> I'm guessing that "after header" was just an implementation error.  It
> was presumably intended to be "after commit", so that the only
> difference between format and tformat is the presence or absence of
> the very last terminator.
> 
> Maybe the correct fix is just to make tformat not broken?

I do agree. 'tformat' is broken. But my point was more that 'tformat' was 
introduced for all the wrong reasons (ie that 'format' was broken, and 
then instead of fixing 'format', people introduced 'tformat' with a 
_different_ brokenness).

		Linus

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Simplify '--prett=xyz' options
  2009-08-15 19:50   ` Linus Torvalds
  2009-08-15 20:16     ` Junio C Hamano
@ 2009-08-15 21:39     ` Linus Torvalds
  1 sibling, 0 replies; 9+ messages in thread
From: Linus Torvalds @ 2009-08-15 21:39 UTC (permalink / raw)
  To: Thomas Rast; +Cc: Junio C Hamano, Git Mailing List



On Sat, 15 Aug 2009, Linus Torvalds wrote:
> 
> I would like to also make "--pretty=oneline" have the same abbrev-commit 
> semantics as "--oneline" has, but I didn't actually do that change.

Here's a patch if anybody cares.

It basically replaces the tests that do

	cut -b42-

or

	sed -e "s/^.\{41\}//"

(to get just the subject) with

	sed -e "s/^[0-9a-f]* //"

instead (which is an already pre-existing pattern that some other tests 
used).

The patch itself was trivial. The only question is whether the semantic 
change is ok (it certainly makes _sense_, it's just silly how "--oneline" 
is different from "--pretty=oneline"). 

This patch obviously depends on the previous one, since it just removes 
the special-casing of "--oneline" (it now falls out automatically from the 
"if you can't recognize the flag, see if it's a format flag" logic, and is 
no longer a special case).

The 'format/tformat' misdesigns I've not touched.

		Linus

---
 pretty.c                      |    4 +++-
 revision.c                    |    4 ----
 t/t3413-rebase-hook.sh        |    2 +-
 t/t5510-fetch.sh              |    2 +-
 t/t6009-rev-list-parent.sh    |    2 +-
 t/t9108-git-svn-glob.sh       |    4 ++--
 t/t9109-git-svn-multi-glob.sh |    6 +++---
 7 files changed, 11 insertions(+), 13 deletions(-)

diff --git a/pretty.c b/pretty.c
index 1a76320..6d0fa60 100644
--- a/pretty.c
+++ b/pretty.c
@@ -52,8 +52,10 @@ int try_get_commit_format(const char *arg, struct rev_info *rev)
 	for (i = 0; i < ARRAY_SIZE(cmt_fmts); i++) {
 		if (!strncmp(arg, cmt_fmts[i].n, cmt_fmts[i].cmp_len) &&
 		    !strncmp(arg, cmt_fmts[i].n, strlen(arg))) {
-			if (cmt_fmts[i].v == CMIT_FMT_ONELINE)
+			if (cmt_fmts[i].v == CMIT_FMT_ONELINE) {
 				rev->use_terminator = 1;
+				rev->abbrev_commit = 1;
+			}
 			rev->commit_format = cmt_fmts[i].v;
 			return 1;
 		}
diff --git a/revision.c b/revision.c
index bdace8b..b7f047a 100644
--- a/revision.c
+++ b/revision.c
@@ -1126,10 +1126,6 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg
 	} else if (!prefixcmp(arg, "--pretty=")) {
 		revs->verbose_header = 1;
 		get_commit_format(arg+9, revs);
-	} else if (!strcmp(arg, "--oneline")) {
-		revs->verbose_header = 1;
-		get_commit_format("oneline", revs);
-		revs->abbrev_commit = 1;
 	} else if (!strcmp(arg, "--graph")) {
 		revs->topo_order = 1;
 		revs->rewrite_parents = 1;
diff --git a/t/t3413-rebase-hook.sh b/t/t3413-rebase-hook.sh
index 098b755..2f14c5c 100755
--- a/t/t3413-rebase-hook.sh
+++ b/t/t3413-rebase-hook.sh
@@ -19,7 +19,7 @@ test_expect_success setup '
 	test_tick &&
 	git commit -m side &&
 	git checkout master &&
-	git log --pretty=oneline --abbrev-commit --graph --all &&
+	git log --oneline --graph --all &&
 	git branch test side
 '
 
diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh
index d13c806..62a45c0 100755
--- a/t/t5510-fetch.sh
+++ b/t/t5510-fetch.sh
@@ -168,7 +168,7 @@ test_expect_success 'bundle 1 has only 3 files ' '
 test_expect_success 'unbundle 2' '
 	cd "$D/bundle" &&
 	git fetch ../bundle2 master:master &&
-	test "tip" = "$(git log -1 --pretty=oneline master | cut -b42-)"
+	test "tip" = "$(git log -1 --pretty=oneline master | sed 's/^[0-9a-f]* //')"
 '
 
 test_expect_success 'bundle does not prerequisite objects' '
diff --git a/t/t6009-rev-list-parent.sh b/t/t6009-rev-list-parent.sh
index c8a96a9..9a90ce8 100755
--- a/t/t6009-rev-list-parent.sh
+++ b/t/t6009-rev-list-parent.sh
@@ -24,7 +24,7 @@ test_expect_success setup '
 	commit three &&
 	commit four &&
 
-	git log --pretty=oneline --abbrev-commit
+	git log --oneline
 '
 
 test_expect_success 'one is ancestor of others and should not be shown' '
diff --git a/t/t9108-git-svn-glob.sh b/t/t9108-git-svn-glob.sh
index d732d31..4d386f2 100755
--- a/t/t9108-git-svn-glob.sh
+++ b/t/t9108-git-svn-glob.sh
@@ -48,7 +48,7 @@ test_expect_success 'test refspec globbing' '
 	                 "tags/*/src/a:refs/remotes/tags/*" &&
 	git svn multi-fetch &&
 	git log --pretty=oneline refs/remotes/tags/end | \
-	    sed -e "s/^.\{41\}//" > output.end &&
+	    sed -e "s/^[0-9a-f]* //" > output.end &&
 	test_cmp expect.end output.end &&
 	test "`git rev-parse refs/remotes/tags/end~1`" = \
 		"`git rev-parse refs/remotes/branches/start`" &&
@@ -82,7 +82,7 @@ test_expect_success 'test left-hand-side only globbing' '
 	test `git rev-parse refs/remotes/two/tags/end~3` = \
 	     `git rev-parse refs/remotes/two/branches/start` &&
 	git log --pretty=oneline refs/remotes/two/tags/end | \
-	    sed -e "s/^.\{41\}//" > output.two &&
+	    sed -e "s/^[0-9a-f]* //" > output.two &&
 	test_cmp expect.two output.two
 	'
 
diff --git a/t/t9109-git-svn-multi-glob.sh b/t/t9109-git-svn-multi-glob.sh
index c318f9f..da93cf1 100755
--- a/t/t9109-git-svn-multi-glob.sh
+++ b/t/t9109-git-svn-multi-glob.sh
@@ -48,7 +48,7 @@ test_expect_success 'test refspec globbing' '
 	                 "tags/*/src/a:refs/remotes/tags/*" &&
 	git svn multi-fetch &&
 	git log --pretty=oneline refs/remotes/tags/end | \
-	    sed -e "s/^.\{41\}//" > output.end &&
+	    sed -e "s/^[0-9a-f]* //" > output.end &&
 	test_cmp expect.end output.end &&
 	test "`git rev-parse refs/remotes/tags/end~1`" = \
 		"`git rev-parse refs/remotes/branches/v1/start`" &&
@@ -82,7 +82,7 @@ test_expect_success 'test left-hand-side only globbing' '
 	test `git rev-parse refs/remotes/two/tags/end~3` = \
 	     `git rev-parse refs/remotes/two/branches/v1/start` &&
 	git log --pretty=oneline refs/remotes/two/tags/end | \
-	    sed -e "s/^.\{41\}//" > output.two &&
+	    sed -e "s/^[0-9a-f]* //" > output.two &&
 	test_cmp expect.two output.two
 	'
 cat > expect.four <<EOF
@@ -131,7 +131,7 @@ test_expect_success 'test another branch' '
 	test `git rev-parse refs/remotes/four/tags/next~2` = \
 	     `git rev-parse refs/remotes/four/branches/v2/start` &&
 	git log --pretty=oneline refs/remotes/four/tags/next | \
-	    sed -e "s/^.\{41\}//" > output.four &&
+	    sed -e "s/^[0-9a-f]* //" > output.four &&
 	test_cmp expect.four output.four
 	'
 

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2009-08-15 21:41 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-15 19:01 Simplify '--prett=xyz' options Linus Torvalds
2009-08-15 19:19 ` Thomas Rast
2009-08-15 19:50   ` Linus Torvalds
2009-08-15 20:16     ` Junio C Hamano
2009-08-15 20:36       ` Linus Torvalds
2009-08-15 21:05         ` Avery Pennarun
2009-08-15 21:29           ` Linus Torvalds
2009-08-15 21:39     ` Linus Torvalds
2009-08-15 20:22 ` Johannes Schindelin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox