From: Elliott Cable <me@ell.io>
To: git@vger.kernel.org
Subject: `format:%>` padding and `git log --graph`
Date: Sun, 20 Dec 2015 10:41:44 -0600 [thread overview]
Message-ID: <CAPZ477ObN53VffNVvHVuqT0MQ2Csu70i0+himmmjvPj1wfXjUQ@mail.gmail.com> (raw)
I'm not sure what version the `%>` / `<|` / etc padding showed up in,
but they're truly excellent for building beautiful one-line `git log`
output.
This may be a long-shot, but, unfortunately, these new formats sort of
fall flat in the presence of `git log --graph`: The ‘pad until column’
feature, which when reading the manpage, I desperately hoped
*specifically exists* to replace the normal ‘pad with spaces’ in
situations where `--graph` adds an un-known number of characters to the
start of the line ... unfortunately doesn't seem to work that way.
For instance, here's some truncated output from a basic `--graph`:
$ git log --graph --abbrev=8 --pretty="tformat:%h %s"
...
* | a4402023 + basic boilerplate for Liability / LiabilityFamily
* | 32ed6de8 Merge branch 'queueless' into queueless+
|\ \
| * \ 1e53ea10 (merge misc) Bring in some `bats` fixes, and re-sty
| |\ \
| | |/
| | * c8c270ff (!! new doc) Add rationale for basically *all* of the
Here's what `%>|(16)%h` gives me:
$ git log --graph --abbrev=8 --pretty="tformat:%>|(16)%h %s"
...
* | a4402023 + basic boilerplate for Liability / LiabilityFa
* | 32ed6de8 Merge branch 'queueless' into queueless+
|\ \
| * \ 1e53ea10 (merge misc) Bring in some `bats` fixes, an
| |\ \
| | |/
| | * c8c270ff (!! new doc) Add rationale for basically *all
Here's something like what I'd *like* to have seen:
$ git log --graph --abbrev=8 --pretty="tformat:%>|(16)%h %s"
...
* | a4402023 + basic boilerplate for Liability / LiabilityFamily
* | 32ed6de8 Merge branch 'queueless' into queueless+
|\ \
| * \ 1e53ea10 (merge misc) Bring in some `bats` fixes, and re-sty
| * \ 1e53ea10 (merge misc) Bring in some `bats` fixes, and re-sty
| |\ \
| | |/
| | * c8c270ff (!! new doc) Add rationale for basically *all* of t
So: Is this nigh-unimplementable? I once [dove into the git-log
source][patch], and I recall the `--graph` code being terrifying; so if
this is difficult to support, I can see why it would be left out.
If I'm off, though, and this is just an oversight, it'd be really neat
to see somebody implement it! (=
⁓ ELLIOTTCABLE — fly safe.
http://ell.io/tt
[patch]: <http://article.gmane.org/gmane.comp.version-control.git/226387>
next reply other threads:[~2015-12-20 16:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-20 16:41 Elliott Cable [this message]
2015-12-22 11:33 ` `format:%>` padding and `git log --graph` Duy Nguyen
2015-12-22 16:08 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAPZ477ObN53VffNVvHVuqT0MQ2Csu70i0+himmmjvPj1wfXjUQ@mail.gmail.com \
--to=me@ell.io \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).