All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] forbid log --graph --no-walk
@ 2015-03-14 21:35 epilys
  0 siblings, 0 replies; 3+ messages in thread
From: epilys @ 2015-03-14 21:35 UTC (permalink / raw)
  To: git; +Cc: gitster, peff

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)
+        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

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

* Re: [PATCH] forbid log --graph --no-walk
  2015-03-14 21:31 epilys
@ 2015-03-14 22:42 ` Kevin D
  0 siblings, 0 replies; 3+ messages in thread
From: Kevin D @ 2015-03-14 22:42 UTC (permalink / raw)
  To: epilys; +Cc: git, gitster, peff

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:
> 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 +)

> +        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

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

* [PATCH] forbid log --graph --no-walk
@ 2015-03-14 21:31 epilys
  2015-03-14 22:42 ` Kevin D
  0 siblings, 1 reply; 3+ messages in thread
From: epilys @ 2015-03-14 21:31 UTC (permalink / raw)
  To: git; +Cc: gitster, peff

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)
+        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

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

end of thread, other threads:[~2015-03-14 22:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-14 21:35 [PATCH] forbid log --graph --no-walk epilys
  -- strict thread matches above, loose matches on Subject: below --
2015-03-14 21:31 epilys
2015-03-14 22:42 ` Kevin D

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.