Re: [PATCH 3/3] show-branch --reflog: show the reflog message at the top.

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH 3/3] show-branch --reflog: show the reflog message at the top.

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:50

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.  I think people may
also appreciate timestamps on Reflog headers you add to the
output.

That change makes

	$ git log --walk-reflogs master..next
        fatal: No reflogs found for 'master..next'

a non issue, for one thing.

Unfortunately,

	$ git log --walk-reflogs ^master next 

is not something I can read and make heads or tails of it.  So
I'll try something smaller:

	$ git log --walk-reflogs ^master jc/show-reflog

shows only three commits (the same as without --walk-reflogs),
although I have tons of rewinds and rebases.  There is something
broken, or perhaps the semantics of --walk-reflogs does not
match what humans would expect when interacting with revision
limiting.  This would also become an non-issue if we do not
allow negative ones.

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

From: Johannes Schindelin <hidden>
Date: 2016-06-15 22:42:50

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