git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* "git stash list" shows HEAD reflog
@ 2010-03-12 14:52 Vladimir Panteleev
  2010-03-13 17:37 ` René Scharfe
  0 siblings, 1 reply; 11+ messages in thread
From: Vladimir Panteleev @ 2010-03-12 14:52 UTC (permalink / raw)
  To: git

I stumbled upon a curious problem with a repository: the command "git  
stash list" displayed the HEAD reflog instead of the stash list.

The problem was caused by a very long line in ".git/logs/refs/stash". (The  
stash was based on a commit imported from Subversion, the commit message  
of which didn't follow git conventions.) The entire line was longer than  
1023 characters, which is the buffer size passed to fgets in  
for_each_recent_reflog_ent. The validation check (buf[len-1] != '\n')  
causes the line to be skipped. The fix should be simple - if the line read  
didn't fit in the buffer, add a newline anyway instead of skipping the  
line entirely.

That doesn't explain why git displayed the HEAD reflog, though. That seems  
to happen thanks to the check (revs->def && !revs->pending.nr) in  
setup_revisions ("HEAD" is the default, as specified in the caller  
cmd_log_init). It looks like (ideally) git shouldn't rely on whether  
revs->pending is empty to decide whether to use the default, but rather if  
a ref was specified by the user or not.

-- 
Best regards,
  Vladimir                            mailto:vladimir@thecybershadow.net

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2010-03-14  6:57 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-12 14:52 "git stash list" shows HEAD reflog Vladimir Panteleev
2010-03-13 17:37 ` René Scharfe
2010-03-13 17:41   ` Dave Olszewski
2010-03-13 20:11     ` René Scharfe
2010-03-13 21:21       ` Re: [git] " Dave Olszewski
2010-03-13 21:49         ` René Scharfe
2010-03-13 22:47           ` [PATCH] don't use default revision if a rev was specified Dave Olszewski
2010-03-13 23:19             ` René Scharfe
2010-03-14  6:57             ` Junio C Hamano
2010-03-13 21:43   ` "git stash list" shows HEAD reflog Pete Harlan
2010-03-13 22:07     ` René Scharfe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).