Thread (2 messages) flat view 2 messages, 2 authors, 2016-06-15
DORMANTno replies

[PATCH] --walk-reflogs: disallow uninteresting commits

From: Johannes Schindelin <hidden>
Date: 2016-06-15 22:42:50
Subsystem: the rest · Maintainer: Linus Torvalds

Possibly related (same subject, not in this thread)

Do not allow uninteresting commits with --walk-reflogs, since it is
not clear what should be shown in these cases:

	$ git log --walk-reflogs master..next
	$ git log --walk-reflogs ^master

Signed-off-by: Johannes Schindelin <redacted>
---

	On Fri, 19 Jan 2007, Junio C Hamano wrote:
	
	> Johannes Schindelin [off-list ref] writes:
	> 
	> > How about failing if there are _uninteresting_ commits? So,
	> >
	> > 	git log --walk-reflogs next master
	> >
	> > still works?
	> 
	> That feels like a good way to deal with it.

	Here you are.

	> I think people may also appreciate timestamps on Reflog headers 
	> you add to the output.

	At the moment, if you ask for @{1} (or leave it out), you will see 
	them enumerated by number. If you ask for @{now}, you will see 
	them identified by date...

 reflog-walk.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/reflog-walk.c b/reflog-walk.c
index d4b49c7..2d97411 100644
--- a/reflog-walk.c
+++ b/reflog-walk.c
@@ -145,6 +145,9 @@ void add_reflog_for_walk(struct reflog_walk_info *info,
 	char *branch, *at = strchr(name, '@');
 	struct commit_reflog *commit_reflog;
 
+	if (commit->object.flags & UNINTERESTING)
+		die ("Cannot walk reflogs for %s", name);
+
 	branch = xstrdup(name);
 	if (at && at[1] == '{') {
 		char *ep;
-- 
1.5.0.rc1.g5a400-dirty
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help