git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Let --decorate show HEAD position
@ 2009-10-12  9:01 Thomas Rast
  2009-10-12 20:06 ` Thomas Rast
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Rast @ 2009-10-12  9:01 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, René Scharfe

'git log --graph --oneline --decorate --all' is a useful way to get a
general overview of the repository state, similar to 'gitk --all'.
Let it indicate the position of HEAD by loading that ref too, so that
the --decorate code can see it.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
---
 log-tree.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/log-tree.c b/log-tree.c
index 1618f3c..f7d54f2 100644
--- a/log-tree.c
+++ b/log-tree.c
@@ -43,6 +43,7 @@ void load_ref_decorations(int flags)
 	if (!loaded) {
 		loaded = 1;
 		for_each_ref(add_ref_decoration, &flags);
+		head_ref(add_ref_decoration, &flags);
 	}
 }
 
-- 
1.6.5.59.g76726.dirty

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

* Re: [PATCH] Let --decorate show HEAD position
  2009-10-12  9:01 [PATCH] Let --decorate show HEAD position Thomas Rast
@ 2009-10-12 20:06 ` Thomas Rast
  2009-10-12 20:34   ` [PATCH v2] " Thomas Rast
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Rast @ 2009-10-12 20:06 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, René Scharfe

Thomas Rast wrote:
> diff --git a/log-tree.c b/log-tree.c
> index 1618f3c..f7d54f2 100644
> --- a/log-tree.c
> +++ b/log-tree.c
> @@ -43,6 +43,7 @@ void load_ref_decorations(int flags)
>  	if (!loaded) {
>  		loaded = 1;
>  		for_each_ref(add_ref_decoration, &flags);
> +		head_ref(add_ref_decoration, &flags);
>  	}
>  }

Damn, this fails tests and I only just noticed while testing another
series.  Sorry for the noise, reroll upcoming...

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

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

* [PATCH v2] Let --decorate show HEAD position
  2009-10-12 20:06 ` Thomas Rast
@ 2009-10-12 20:34   ` Thomas Rast
  2009-10-12 21:05     ` Junio C Hamano
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Rast @ 2009-10-12 20:34 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, René Scharfe

'git log --graph --oneline --decorate --all' is a useful way to get a
general overview of the repository state, similar to 'gitk --all'.
Let it indicate the position of HEAD by loading that ref too, so that
the --decorate code can see it.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
---

I wrote:
> Damn, this fails tests and I only just noticed while testing another
> series.  Sorry for the noise, reroll upcoming...


 log-tree.c                             |    1 +
 t/t4013/diff.log_--decorate=full_--all |    2 +-
 t/t4013/diff.log_--decorate_--all      |    2 +-
 3 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/log-tree.c b/log-tree.c
index 1618f3c..f7d54f2 100644
--- a/log-tree.c
+++ b/log-tree.c
@@ -43,6 +43,7 @@ void load_ref_decorations(int flags)
 	if (!loaded) {
 		loaded = 1;
 		for_each_ref(add_ref_decoration, &flags);
+		head_ref(add_ref_decoration, &flags);
 	}
 }
 
diff --git a/t/t4013/diff.log_--decorate=full_--all b/t/t4013/diff.log_--decorate=full_--all
index 903d9d9..d155e0b 100644
--- a/t/t4013/diff.log_--decorate=full_--all
+++ b/t/t4013/diff.log_--decorate=full_--all
@@ -1,5 +1,5 @@
 $ git log --decorate=full --all
-commit 59d314ad6f356dd08601a4cd5e530381da3e3c64 (refs/heads/master)
+commit 59d314ad6f356dd08601a4cd5e530381da3e3c64 (HEAD, refs/heads/master)
 Merge: 9a6d494 c7a2ab9
 Author: A U Thor <author@example.com>
 Date:   Mon Jun 26 00:04:00 2006 +0000
diff --git a/t/t4013/diff.log_--decorate_--all b/t/t4013/diff.log_--decorate_--all
index 954210e..fd7c3e6 100644
--- a/t/t4013/diff.log_--decorate_--all
+++ b/t/t4013/diff.log_--decorate_--all
@@ -1,5 +1,5 @@
 $ git log --decorate --all
-commit 59d314ad6f356dd08601a4cd5e530381da3e3c64 (master)
+commit 59d314ad6f356dd08601a4cd5e530381da3e3c64 (HEAD, master)
 Merge: 9a6d494 c7a2ab9
 Author: A U Thor <author@example.com>
 Date:   Mon Jun 26 00:04:00 2006 +0000
-- 
1.6.5.62.g4370d.dirty

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

* Re: [PATCH v2] Let --decorate show HEAD position
  2009-10-12 20:34   ` [PATCH v2] " Thomas Rast
@ 2009-10-12 21:05     ` Junio C Hamano
  2009-10-12 21:11       ` Thomas Rast
  0 siblings, 1 reply; 5+ messages in thread
From: Junio C Hamano @ 2009-10-12 21:05 UTC (permalink / raw)
  To: Thomas Rast; +Cc: git, René Scharfe

Thomas Rast <trast@student.ethz.ch> writes:

> 'git log --graph --oneline --decorate --all' is a useful way to get a
> general overview of the repository state, similar to 'gitk --all'.
> Let it indicate the position of HEAD by loading that ref too, so that
> the --decorate code can see it.
>
> Signed-off-by: Thomas Rast <trast@student.ethz.ch>
> ---

I think this makes sense.

I see HEAD is given at the front in the sample output, which I think also
makes sense.  Is it because it is pushed the last?  If so, the same commit
at the tip of branch alpha and beta are decorated with beta and then
alpha, I have to wonder...?

>
> I wrote:
>> Damn, this fails tests and I only just noticed while testing another
>> series.  Sorry for the noise, reroll upcoming...
>
>
>  log-tree.c                             |    1 +
>  t/t4013/diff.log_--decorate=full_--all |    2 +-
>  t/t4013/diff.log_--decorate_--all      |    2 +-
>  3 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/log-tree.c b/log-tree.c
> index 1618f3c..f7d54f2 100644
> --- a/log-tree.c
> +++ b/log-tree.c
> @@ -43,6 +43,7 @@ void load_ref_decorations(int flags)
>  	if (!loaded) {
>  		loaded = 1;
>  		for_each_ref(add_ref_decoration, &flags);
> +		head_ref(add_ref_decoration, &flags);
>  	}
>  }
>  
> diff --git a/t/t4013/diff.log_--decorate=full_--all b/t/t4013/diff.log_--decorate=full_--all
> index 903d9d9..d155e0b 100644
> --- a/t/t4013/diff.log_--decorate=full_--all
> +++ b/t/t4013/diff.log_--decorate=full_--all
> @@ -1,5 +1,5 @@
>  $ git log --decorate=full --all
> -commit 59d314ad6f356dd08601a4cd5e530381da3e3c64 (refs/heads/master)
> +commit 59d314ad6f356dd08601a4cd5e530381da3e3c64 (HEAD, refs/heads/master)
>  Merge: 9a6d494 c7a2ab9
>  Author: A U Thor <author@example.com>
>  Date:   Mon Jun 26 00:04:00 2006 +0000
> diff --git a/t/t4013/diff.log_--decorate_--all b/t/t4013/diff.log_--decorate_--all
> index 954210e..fd7c3e6 100644
> --- a/t/t4013/diff.log_--decorate_--all
> +++ b/t/t4013/diff.log_--decorate_--all
> @@ -1,5 +1,5 @@
>  $ git log --decorate --all
> -commit 59d314ad6f356dd08601a4cd5e530381da3e3c64 (master)
> +commit 59d314ad6f356dd08601a4cd5e530381da3e3c64 (HEAD, master)
>  Merge: 9a6d494 c7a2ab9
>  Author: A U Thor <author@example.com>
>  Date:   Mon Jun 26 00:04:00 2006 +0000
> -- 
> 1.6.5.62.g4370d.dirty

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

* Re: [PATCH v2] Let --decorate show HEAD position
  2009-10-12 21:05     ` Junio C Hamano
@ 2009-10-12 21:11       ` Thomas Rast
  0 siblings, 0 replies; 5+ messages in thread
From: Thomas Rast @ 2009-10-12 21:11 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, René Scharfe

Junio C Hamano wrote:
> 
> I see HEAD is given at the front in the sample output, which I think also
> makes sense.  Is it because it is pushed the last?  If so, the same commit
> at the tip of branch alpha and beta are decorated with beta and then
> alpha, I have to wonder...?

Indeed.  I wrote this off as a lucky coincidence coming from HEAD
sorting before any lowercase letters, but it's exactly as you say:

  commit a0f7579d38feb8c4d87282a6cecbc6778908f19f (test-b, test-a, next)
  Merge: 01287fd 548bc3a
  Author: Thomas Rast <trast@student.ethz.ch>
  [...]

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

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

end of thread, other threads:[~2009-10-12 21:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-12  9:01 [PATCH] Let --decorate show HEAD position Thomas Rast
2009-10-12 20:06 ` Thomas Rast
2009-10-12 20:34   ` [PATCH v2] " Thomas Rast
2009-10-12 21:05     ` Junio C Hamano
2009-10-12 21:11       ` Thomas Rast

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).