threads / patch / 38808

v2log: forbid log --graph --no-walk

Subject: [GSoC][PATCH v2] log: forbid log --graph --no-walk

## tl;dr

4 messages between Mar 14, 2015 and Mar 15, 2015. Diffs are folded; open one to read it.

replies: 3people: 2as markdown or json

epilys· Mar 14, 2015, 23:33 UTC · lore

In git-log, --graph shows a graphical representation of a continuous commit history, and --no-walk shows discrete specified commits without continuity. Using both doesn't make sense, so we forbid the combined use of these flags.

Signed-off-by: Manos Pitsidianakis <epilys@norn.io>
---
 builtin/log.c  | 2 ++
 t/t4202-log.sh | 4 ++++
 2 files changed, 6 insertions(+)
Show changes to 2 files +6 −0

builtin/log.c, t/t4202-log.sh

diff --git a/builtin/log.c b/builtin/log.c
index dd8f3fc..0194133 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -155,6 +155,8 @@ static void cmd_log_init_finish(int argc, const char **argv, const char *prefix,
 	memset(&w, 0, sizeof(w));
 	userformat_find_requirements(NULL, &w);
 
+    if (rev->graph && rev->no_walk)
+        die("--graph and --no-walk are incompatible");
 	if (!rev->show_notes_given && (!rev->pretty_given || w.notes))
 		rev->show_notes = 1;
 	if (rev->show_notes)
diff --git a/t/t4202-log.sh b/t/t4202-log.sh
index 5f2b290..4dd939b 100755
--- a/t/t4202-log.sh
+++ b/t/t4202-log.sh
@@ -887,4 +887,8 @@ test_expect_success GPG 'log --graph --show-signature for merged tag' '
 	grep "^| | gpg: Good signature" actual
 '
 
+test_expect_success 'forbid log --graph --no-walk' '
+    test_must_fail git log --graph --no-walk
+'
+
 test_done
-- 
2.1.4
brian m. carlson· Mar 14, 2015, 23:47 UTC · re: epilys · lore

Re: [GSoC][PATCH v2] log: forbid log --graph --no-walk

On Sun, Mar 15, 2015 at 01:33:07AM +0200, epilys wrote:
Show 10 quoted lines
> diff --git a/builtin/log.c b/builtin/log.c
> index dd8f3fc..0194133 100644
> --- a/builtin/log.c
> +++ b/builtin/log.c
> @@ -155,6 +155,8 @@ static void cmd_log_init_finish(int argc, const char **argv, const char *prefix,
>  	memset(&w, 0, sizeof(w));
>  	userformat_find_requirements(NULL, &w);
>  
> +    if (rev->graph && rev->no_walk)
> +        die("--graph and --no-walk are incompatible");

It looks like you indented here with four spaces instead of a tab. We prefer tabs in Git.

Show 13 quoted lines
>  	if (!rev->show_notes_given && (!rev->pretty_given || w.notes))
>  		rev->show_notes = 1;
>  	if (rev->show_notes)
> diff --git a/t/t4202-log.sh b/t/t4202-log.sh
> index 5f2b290..4dd939b 100755
> --- a/t/t4202-log.sh
> +++ b/t/t4202-log.sh
> @@ -887,4 +887,8 @@ test_expect_success GPG 'log --graph --show-signature for merged tag' '
>  	grep "^| | gpg: Good signature" actual
>  '
>  
> +test_expect_success 'forbid log --graph --no-walk' '
> +    test_must_fail git log --graph --no-walk
And here as well.
-- 
brian m. carlson / brian with sandals: Houston, Texas, US
+1 832 623 2791 | http://www.crustytoothpaste.net/~bmc | My opinion only
OpenPGP: RSA v4 4096b: 88AC E9B2 9196 305B A994 7552 F1BA 225C 0223 B187
epilys· Mar 14, 2015, 23:55 UTC · re: brian m. carlson · lore

Re: [GSoC][PATCH v2] log: forbid log --graph --no-walk

On 03/15/2015 01:47 AM, brian m. carlson wrote:
> It looks like you indented here with four spaces instead of a tab. 
> We prefer tabs in Git.

Messed that up. Do you think I should resubmit a v3 or am I hogging the mailing list too much?

brian m. carlson· Mar 15, 2015, 00:04 UTC · re: epilys · lore

Re: [GSoC][PATCH v2] log: forbid log --graph --no-walk

On Sun, Mar 15, 2015 at 01:55:28AM +0200, epilys wrote:
Show 6 quoted lines
> On 03/15/2015 01:47 AM, brian m. carlson wrote:
> > It looks like you indented here with four spaces instead of a tab. 
> > We prefer tabs in Git.
> 
> Messed that up. Do you think I should resubmit a v3 or am I hogging
> the mailing list too much?

You're going to want to submit a v3. While you're at it, you probably want to drop the [GSoC] from the patch header, as it will be part of the commit message when applied, and we don't want that. Finally, you probably want to use your full name in the From: line, as that will be used to create the commit, and we prefer full names over aliases as well.

It can be helpful to try formatting the patch with git format-patch and then checking over it with less and applying it with git am to see how it will look to other Git developers.

This is a small patch, so it's not as big a deal, but for larger series I generally try to wait two or three days (at least one of which is a weekday) before posting a new version so that people have time to read, test, and comment on it.

-- 
brian m. carlson / brian with sandals: Houston, Texas, US
+1 832 623 2791 | http://www.crustytoothpaste.net/~bmc | My opinion only
OpenPGP: RSA v4 4096b: 88AC E9B2 9196 305B A994 7552 F1BA 225C 0223 B187

← back to recent threads