threads / patch / 38806

patchforbid log --graph --no-walk

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

## tl;dr

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

replies: 1people: 2as markdown or json

epilys· Mar 14, 2015, 21:31 UTC · lore

In git-log, --graph shows a graphical representation of a continuous commit history, and --no-walk shows discrete specified commits without continuity. This 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 +4 −1

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
Kevin D· Mar 14, 2015, 22:42 UTC · re: epilys · lore

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

Subject is usually prefixed with the part that is changed, in this case log.

For example: 
log: forbid log --graph --no-walk
On Sat, Mar 14, 2015 at 11:31:59PM +0200, epilys wrote:
Show 20 quoted lines
> In git-log, --graph shows a graphical representation of a
> continuous commit history, and --no-walk shows discrete specified
> commits without continuity. This 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(+)
> 
> 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)
Patch got corrupted here (Space before +)
Show 13 quoted lines
> +        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' '
Here also
> +    test_must_fail git log --graph --no-walk
> +'
> +
>  test_done

← back to recent threads