From 3384a2dfc12f0fecd25ecfd6bfa9ee0d82517bf2 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Tue, 11 Dec 2007 10:09:04 -0800 Subject: 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 --- revision.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'revision.h') diff --git a/revision.h b/revision.h index 992e1e9dd5..8572315954 100644 --- a/revision.h +++ b/revision.h @@ -130,6 +130,8 @@ extern void add_object(struct object *obj, extern void add_pending_object(struct rev_info *revs, struct object *obj, const char *name); +extern void add_head_to_pending(struct rev_info *); + enum commit_action { commit_ignore, commit_show, -- cgit v1.2.3