summaryrefslogtreecommitdiff
path: root/builtin-log.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2007-12-11 10:09:04 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2007-12-11 17:01:31 -0800
commit3384a2dfc12f0fecd25ecfd6bfa9ee0d82517bf2 (patch)
treed9a4d8565acee4ff9423178442f87b1efe815c14 /builtin-log.c
parentInvert numbers and names in the git-shortlog summary mode. (diff)
downloadtgif-3384a2dfc12f0fecd25ecfd6bfa9ee0d82517bf2.tar.xz
shortlog: default to HEAD when the standard input is a tty
Instead of warning the user that it is expecting git log output from the standard input (and waiting for the user to type the log from the keyboard, which is a silly thing to do), default to traverse from HEAD when there is no rev parameter given and the standard input is a tty. This factors out a useful helper "add_head()" from builtin-diff.c to a more appropriate place revision.c while renaming it to more descriptive name add_head_to_pending(), as that is what the function is about. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-log.c')
-rw-r--r--builtin-log.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/builtin-log.c b/builtin-log.c
index e1f1cf6714..d375c9dbf9 100644
--- a/builtin-log.c
+++ b/builtin-log.c
@@ -18,9 +18,6 @@
static int default_show_root = 1;
static const char *fmt_patch_subject_prefix = "PATCH";
-/* this is in builtin-diff.c */
-void add_head(struct rev_info *revs);
-
static void add_name_decoration(const char *prefix, const char *name, struct object *obj)
{
int plen = strlen(prefix);
@@ -746,7 +743,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
* does not have.
*/
rev.pending.objects[0].item->flags |= UNINTERESTING;
- add_head(&rev);
+ add_head_to_pending(&rev);
}
/*
* Otherwise, it is "format-patch -22 HEAD", and/or