git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* How to trim the fat on my log graphs
@ 2014-04-22 20:50 Robert Dailey
  2014-04-22 21:37 ` Junio C Hamano
  0 siblings, 1 reply; 8+ messages in thread
From: Robert Dailey @ 2014-04-22 20:50 UTC (permalink / raw)
  To: Git

My log graphs are pretty insane sometimes because we converted our
repo from SVN and haven't had a chance to delete all of the remote
branches. We still have quite a few (maybe 20).

When I do `git log`, I am shown about 10-15 vertical lines and the
branch I currently have checked out isn't even at the top of the
graph, it's burried somewhere one or two pages down. I think this is
really confusing and makes my log virtually useless. Here is my log
command:

git log log --graph --abbrev-commit --decorate --date=relative
--format=format:'%C(bold blue)%h%C(reset)%x09%C(bold
green)(%ar)%C(reset)%C(bold yellow)%d%C(reset) %C(dim
white)%an%C(reset) - %C(white)%s%C(reset)' --branches --remotes

I realize the `git log` documentation has a whole section on trimming
history so it is more useful, but after reading that section I am left
completely confused and I have no idea which additional options I can
add to trim the fat on my logs.

Ideally what I want, for starters:
- The branch I'm on should be at the top of the graph (first commit in
the log graph should be the tip of my checked out branch).
- Commits in other branches that are not ancestors of the current
branch should not be shown.
- Merges *into* my branch from other branches should show the graph
line for that branch but allow me to specify a "depth", meaning for
example that ancestors that are 3 "parents" away
(great-grandchildren?) will not be rendered (the 3 is an example, I
could specify any number)

The goal is to weed out the really distant and irrelevant commits. I
really just want to see the commits that are closely related to my
current branch. Thanks in advance.

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

* Re: How to trim the fat on my log graphs
  2014-04-22 20:50 How to trim the fat on my log graphs Robert Dailey
@ 2014-04-22 21:37 ` Junio C Hamano
  2014-04-23 16:32   ` Robert Dailey
  0 siblings, 1 reply; 8+ messages in thread
From: Junio C Hamano @ 2014-04-22 21:37 UTC (permalink / raw)
  To: Robert Dailey; +Cc: Git

Robert Dailey <rcdailey.lists@gmail.com> writes:

> git log log --graph --abbrev-commit --decorate --date=relative
> --format=format:'%C(bold blue)%h%C(reset)%x09%C(bold
> green)(%ar)%C(reset)%C(bold yellow)%d%C(reset) %C(dim
> white)%an%C(reset) - %C(white)%s%C(reset)' --branches --remotes
> ...
> The goal is to weed out the really distant and irrelevant commits. I
> really just want to see the commits that are closely related to my
> current branch. Thanks in advance.

For a starter, how about dropping "--branches --remotes" from that
command line?  A merge from elsewhere will show as "Merge branch foo"
which should be sufficient without the decoration.

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

* Re: How to trim the fat on my log graphs
  2014-04-22 21:37 ` Junio C Hamano
@ 2014-04-23 16:32   ` Robert Dailey
  2014-04-23 17:30     ` Junio C Hamano
  0 siblings, 1 reply; 8+ messages in thread
From: Robert Dailey @ 2014-04-23 16:32 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Git

Thanks, removing those two options did help quite a bit already.
However, the history can still get pretty crazy. Is there a way to
hide all tags from the log graph? Really I just want the LABELS to be
hidden.

On Tue, Apr 22, 2014 at 4:37 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Robert Dailey <rcdailey.lists@gmail.com> writes:
>
>> git log log --graph --abbrev-commit --decorate --date=relative
>> --format=format:'%C(bold blue)%h%C(reset)%x09%C(bold
>> green)(%ar)%C(reset)%C(bold yellow)%d%C(reset) %C(dim
>> white)%an%C(reset) - %C(white)%s%C(reset)' --branches --remotes
>> ...
>> The goal is to weed out the really distant and irrelevant commits. I
>> really just want to see the commits that are closely related to my
>> current branch. Thanks in advance.
>
> For a starter, how about dropping "--branches --remotes" from that
> command line?  A merge from elsewhere will show as "Merge branch foo"
> which should be sufficient without the decoration.

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

* Re: How to trim the fat on my log graphs
  2014-04-23 16:32   ` Robert Dailey
@ 2014-04-23 17:30     ` Junio C Hamano
  2014-04-23 19:59       ` Robert Dailey
  2014-04-23 21:02       ` Felipe Contreras
  0 siblings, 2 replies; 8+ messages in thread
From: Junio C Hamano @ 2014-04-23 17:30 UTC (permalink / raw)
  To: Robert Dailey; +Cc: Git

Robert Dailey <rcdailey.lists@gmail.com> writes:

[Administrivia: because people read from top to bottom / why is it
bad to top-post? / please do not top-post.]

> On Tue, Apr 22, 2014 at 4:37 PM, Junio C Hamano <gitster@pobox.com> wrote:
>> Robert Dailey <rcdailey.lists@gmail.com> writes:
>>
>>> git log log --graph --abbrev-commit --decorate --date=relative
>>> --format=format:'%C(bold blue)%h%C(reset)%x09%C(bold
>>> green)(%ar)%C(reset)%C(bold yellow)%d%C(reset) %C(dim
>>> white)%an%C(reset) - %C(white)%s%C(reset)' --branches --remotes
>>> ...
>>> The goal is to weed out the really distant and irrelevant commits. I
>>> really just want to see the commits that are closely related to my
>>> current branch. Thanks in advance.
>>
>> For a starter, how about dropping "--branches --remotes" from that
>> command line?  A merge from elsewhere will show as "Merge branch foo"
>> which should be sufficient without the decoration.
>
> Thanks, removing those two options did help quite a bit already.
> However, the history can still get pretty crazy. Is there a way to
> hide all tags from the log graph? Really I just want the LABELS to be
> hidden.

As you had --decorate and a lot of %C(cruft), I was assuming that
you do want to see all the bells and whistles when I suggested to
omit --branches and --remotes.

If you do not want --decorate, I think you can omit that from the
command line without changing what the output means.

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

* Re: How to trim the fat on my log graphs
  2014-04-23 17:30     ` Junio C Hamano
@ 2014-04-23 19:59       ` Robert Dailey
  2014-04-23 20:15         ` Junio C Hamano
  2014-04-23 20:44         ` Jeff King
  2014-04-23 21:02       ` Felipe Contreras
  1 sibling, 2 replies; 8+ messages in thread
From: Robert Dailey @ 2014-04-23 19:59 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Git

On Wed, Apr 23, 2014 at 12:30 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Robert Dailey <rcdailey.lists@gmail.com> writes:
>
> [Administrivia: because people read from top to bottom / why is it
> bad to top-post? / please do not top-post.]
>
>> On Tue, Apr 22, 2014 at 4:37 PM, Junio C Hamano <gitster@pobox.com> wrote:
>>> Robert Dailey <rcdailey.lists@gmail.com> writes:
>>>
>>>> git log log --graph --abbrev-commit --decorate --date=relative
>>>> --format=format:'%C(bold blue)%h%C(reset)%x09%C(bold
>>>> green)(%ar)%C(reset)%C(bold yellow)%d%C(reset) %C(dim
>>>> white)%an%C(reset) - %C(white)%s%C(reset)' --branches --remotes
>>>> ...
>>>> The goal is to weed out the really distant and irrelevant commits. I
>>>> really just want to see the commits that are closely related to my
>>>> current branch. Thanks in advance.
>>>
>>> For a starter, how about dropping "--branches --remotes" from that
>>> command line?  A merge from elsewhere will show as "Merge branch foo"
>>> which should be sufficient without the decoration.
>>
>> Thanks, removing those two options did help quite a bit already.
>> However, the history can still get pretty crazy. Is there a way to
>> hide all tags from the log graph? Really I just want the LABELS to be
>> hidden.
>
> As you had --decorate and a lot of %C(cruft), I was assuming that
> you do want to see all the bells and whistles when I suggested to
> omit --branches and --remotes.
>
> If you do not want --decorate, I think you can omit that from the
> command line without changing what the output means.

I referred back to the documentation for --decorate:

--decorate[=short|full|no]
Print out the ref names of any commits that are shown. If short is
specified, the ref name prefixesrefs/heads/, refs/tags/ and
refs/remotes/ will not be printed. If full is specified, the full ref
name (including prefix) will be printed. The default option is short.

since default is short, and its documented to exclude tag names, I
would expect them to not be there. I also tried removing it to test
but i saw no difference; tag names are still visible.

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

* Re: How to trim the fat on my log graphs
  2014-04-23 19:59       ` Robert Dailey
@ 2014-04-23 20:15         ` Junio C Hamano
  2014-04-23 20:44         ` Jeff King
  1 sibling, 0 replies; 8+ messages in thread
From: Junio C Hamano @ 2014-04-23 20:15 UTC (permalink / raw)
  To: Robert Dailey; +Cc: Git

Robert Dailey <rcdailey.lists@gmail.com> writes:

> On Wed, Apr 23, 2014 at 12:30 PM, Junio C Hamano <gitster@pobox.com> wrote:
>> Robert Dailey <rcdailey.lists@gmail.com> writes:
>>
>> [Administrivia: because people read from top to bottom / why is it
>> bad to top-post? / please do not top-post.]
>>
>>> On Tue, Apr 22, 2014 at 4:37 PM, Junio C Hamano <gitster@pobox.com> wrote:
>>>> Robert Dailey <rcdailey.lists@gmail.com> writes:
>>>>
>>>>> git log log --graph --abbrev-commit --decorate --date=relative
>>>>> --format=format:'%C(bold blue)%h%C(reset)%x09%C(bold
>>>>> green)(%ar)%C(reset)%C(bold yellow)%d%C(reset) %C(dim
>>>>> white)%an%C(reset) - %C(white)%s%C(reset)' --branches --remotes
>>>>> ...
> ... I also tried removing it to test
> but i saw no difference; tag names are still visible.

I do not use these eye-candies myself (they are too distracting for
me), but doesn't "%d" in the format string mean "decorate"?

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

* Re: How to trim the fat on my log graphs
  2014-04-23 19:59       ` Robert Dailey
  2014-04-23 20:15         ` Junio C Hamano
@ 2014-04-23 20:44         ` Jeff King
  1 sibling, 0 replies; 8+ messages in thread
From: Jeff King @ 2014-04-23 20:44 UTC (permalink / raw)
  To: Robert Dailey; +Cc: Junio C Hamano, Git

On Wed, Apr 23, 2014 at 02:59:26PM -0500, Robert Dailey wrote:

> I referred back to the documentation for --decorate:
> 
> --decorate[=short|full|no]
> Print out the ref names of any commits that are shown. If short is
> specified, the ref name prefixesrefs/heads/, refs/tags/ and
> refs/remotes/ will not be printed. If full is specified, the full ref
> name (including prefix) will be printed. The default option is short.
> 
> since default is short, and its documented to exclude tag names, I
> would expect them to not be there. I also tried removing it to test
> but i saw no difference; tag names are still visible.

Are you reading that as "if short is specified, then refs whose names
are prefixed with refs/heads, refs/tags, etc will be omitted entirely
from decoration"?

The intent is "if short is specified, then a ref whose names has the
prefix of refs/heads, refs/tags, etc, will have that prefix removed when
showing it".

IOW, the options are:

  $ git log -1 --no-decorate | head -1
  commit 0bc85abb7aa9b24b093253018801a0fb43d01122

  $ git log -1 --decorate=short | head -1
  commit 0bc85abb7aa9b24b093253018801a0fb43d01122 (HEAD, tag: v1.9.2, origin/maint)

  $ git log -1 --decorate=full | head -1
  commit 0bc85abb7aa9b24b093253018801a0fb43d01122 (HEAD, tag: refs/tags/v1.9.2, refs/remotes/origin/maint)

If that's the confusion, feel free to suggest better wording for the
documentation.

-Peff

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

* Re: How to trim the fat on my log graphs
  2014-04-23 17:30     ` Junio C Hamano
  2014-04-23 19:59       ` Robert Dailey
@ 2014-04-23 21:02       ` Felipe Contreras
  1 sibling, 0 replies; 8+ messages in thread
From: Felipe Contreras @ 2014-04-23 21:02 UTC (permalink / raw)
  To: Junio C Hamano, Robert Dailey; +Cc: Git

Junio C Hamano wrote:
> Robert Dailey <rcdailey.lists@gmail.com> writes:
> 
> [Administrivia: because people read from top to bottom / why is it
> bad to top-post? / please do not top-post.]

https://en.wikipedia.org/wiki/Posting_style

-- 
Felipe Contreras

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

end of thread, other threads:[~2014-04-23 21:18 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-22 20:50 How to trim the fat on my log graphs Robert Dailey
2014-04-22 21:37 ` Junio C Hamano
2014-04-23 16:32   ` Robert Dailey
2014-04-23 17:30     ` Junio C Hamano
2014-04-23 19:59       ` Robert Dailey
2014-04-23 20:15         ` Junio C Hamano
2014-04-23 20:44         ` Jeff King
2014-04-23 21:02       ` Felipe Contreras

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