From: Linus Torvalds <torvalds@osdl.org>
To: Junio C Hamano <junkio@cox.net>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 2/2] git-log (internal): more options.
Date: Wed, 1 Mar 2006 07:43:26 -0800 (PST) [thread overview]
Message-ID: <Pine.LNX.4.64.0603010730520.22647@g5.osdl.org> (raw)
In-Reply-To: <7vbqwqgxo8.fsf@assigned-by-dhcp.cox.net>
On Wed, 1 Mar 2006, Junio C Hamano wrote:
>
> This ports the following options from rev-list based git-log
> implementation:
>
> * -<n>, -n<n>, and -n <n>. I am still wondering if we want
> this natively supported by setup_revisions(), which already
> takes --max-count. We may want to move them in the next
> round. Also I am not sure if we can get away with not
> setting revs->limited when we set max-count. The latest
> rev-list.c and revision.c in this series do not, so I left
> them as they are.
>
> * --pretty and --pretty=<fmt>.
>
> * --abbrev=<n> and --no-abbrev.
Looks good.
I _suspect_ that we want to handle them all in setup_revision(), but I
wasn't sure, so I left them in rev-list.c originally.
Most helpers that want a list of commits probably want the printing
options too, and the ones that do not probably simply don't care (ie if
they silently pass a "--pretty=raw" without it affecting anything, who
really cares?)
> The previous commit already handles time-based limiters
> (--since, --until and friends). The remaining things that
> rev-list based git-log happens to do are not useful in a pure
> log-viewing purposes, and not ported:
>
> * --bisect (obviously).
>
> * --header. I am actually in favor of doing the NUL
> terminated record format, but rev-list based one always
> passed --pretty, which defeated this option. Maybe next
> round.
>
> * --parents. I do not think of a reason a log viewer wants
> this. The flag is primarily for feeding squashed history
> via pipe to downstream tools.
I can actually imagine using "--parents" as a way of parsing both the
commit log and the history. Of course, any such use is likely in a script,
at which point the script probably doesn't actually want "git log", but
just a raw "git-rev-list".
After all, the only _real_ difference between "git log" and "git-rev-list"
is the purely syntactic one (things like defaulting to HEAD in "git log"
and requiring revisions in git-rev-list), and the use of PAGER.
To me, the question whether a flag would be parsed in the "revision.c"
library or in the "rev-list.c" binary was more a question of whether that
flag makes sense for other things than just "git log".
For example, "git whatchanged" and "git diff" could both use
setup_revision(), although "git diff" wouldn't actually _walk_ the
revisions (it would just look at the "revs->commits" list to see what was
passed in).
"git whatchanged" would obviously take all the same flags "git log" does,
and "git diff" could take them and just test the values for sanity (ie
error out if min/max_date is not -1, for example).
"git show" is like a "git-whatchanged" except it wouldn't walk the diffs
(I considered adding a "--nowalk" option to setup_revisions(), which would
just suppress the "add_parents_to_list()" entirely)
Linus
next prev parent reply other threads:[~2006-03-01 15:43 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-28 19:19 [PATCH 0/3] git-rev-list libification effort: the next stage Linus Torvalds
2006-02-28 19:24 ` [PATCH 1/3] git-rev-list libification: rev-list walking Linus Torvalds
2006-02-28 19:26 ` [PATCH 2/3] Introduce trivial new pager.c helper infrastructure Linus Torvalds
2006-02-28 19:30 ` [PATCH 3/3] Tie it all together: "git log" Linus Torvalds
2006-02-28 20:59 ` Linus Torvalds
2006-02-28 22:22 ` Junio C Hamano
2006-02-28 23:07 ` Linus Torvalds
2006-03-01 12:24 ` [PATCH 1/2] git-log (internal): add approxidate Junio C Hamano
2006-03-01 12:24 ` [PATCH 2/2] git-log (internal): more options Junio C Hamano
2006-03-01 15:43 ` Linus Torvalds [this message]
2006-03-01 20:06 ` Junio C Hamano
2006-02-28 23:38 ` [PATCH 3/3] Tie it all together: "git log" Martin Langhoff
2006-03-01 9:02 ` 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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.64.0603010730520.22647@g5.osdl.org \
--to=torvalds@osdl.org \
--cc=git@vger.kernel.org \
--cc=junkio@cox.net \
/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.
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).