diff options
author | Linus Torvalds <torvalds@osdl.org> | 2005-10-25 15:24:55 -0700 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2005-10-26 16:49:38 -0700 |
commit | 7b34c2fae0d2875b35ad1cc0e416b9c2b9b02b1f (patch) | |
tree | c148c898d13e9ff6eedd3b2968a0fe37052efab4 /rev-parse.c | |
parent | bd321bcc51e95f644ac5335abe673afcbcaade62 (diff) | |
download | git-7b34c2fae0d2875b35ad1cc0e416b9c2b9b02b1f.tar.gz |
git-rev-list: make --dense the default (and introduce "--sparse")
This actually does three things:
- make "--dense" the default for git-rev-list. Since dense is a no-op if
no filenames are given, this doesn't actually change any historical
behaviour, but it's logically the right default (if we want to prune on
filenames, do it fully. The sparse "merge-only" thing may be useful,
but it's not what you'd normally expect)
- make "git-rev-parse" show the default revision control before it shows
any pathnames.
This was a real bug, but nobody would ever have noticed, because
the default thing tends to only make sense for git-rev-list, and
git-rev-list didn't use to take pathnames.
- it changes "git-rev-list" to match the other commands that take a mix
of revisions and filenames - it no longer requires the "--" before
filenames (although you still need to do it if a filename could be
confused with a revision name, eg "gitk" in the git archive)
This all just makes for much more pleasant and obvous usage. Just doing a
gitk t/
does the obvious thing: it will show the history as it concerns the "t/"
subdirectory.
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'rev-parse.c')
-rw-r--r-- | rev-parse.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/rev-parse.c b/rev-parse.c index 243f89f3cc..adfc68c9be 100644 --- a/rev-parse.c +++ b/rev-parse.c @@ -153,6 +153,7 @@ static void show_datestring(const char *flag, const char *datestr) static void show_file(const char *arg) { + show_default(); if ((filter & (DO_NONFLAGS|DO_NOREV)) == (DO_NONFLAGS|DO_NOREV)) show(arg); } @@ -174,7 +175,6 @@ int main(int argc, char **argv) if (*arg == '-') { if (!strcmp(arg, "--")) { as_is = 1; - show_default(); /* Pass on the "--" if we show anything but files.. */ if (filter & (DO_FLAGS | DO_REVS)) show_file(arg); |