• Kyle Meyer's avatar
    magit-log-wash-rev: don't choke on empty reflog messages · 2a268e20
    Kyle Meyer authored
    When the current branch is renamed, the entry for this event in HEAD's
    reflog has an empty message [1].  The empty message causes issues for
    magit-log-reflog-re, which will match beyond the current line to find
    the "refsub".
    
    As an example, the raw output
    
        86904ee5^@kyle Meyer^@HEAD@{1484792543 -0500}^@
        86904ee5^@kyle Meyer^@HEAD@{1484791872 -0500}^@commit (amend): msg
        c17b5061^@kyle Meyer^@HEAD@{1484791742 -0500}^@commit (amend): msg
    
    is washed to
    
        86904ee5 0
        86904ee5^@kyle   msg
        86904ee5 1  amend            msg
        c17b5061 2  amend            msg
    
    instead of
    
        86904ee5 0
        86904ee5 1  amend            msg
        c17b5061 2  amend            msg
    
    To handle these lines, tighten magit-log-reflog-re so that it doesn't
    allow the refsub to match newlines, and teach magit-log-wash-rev to
    insert the reflog count even when refsub has a nil value.
    
    Although these mostly blank lines aren't very informative, it's
    probably worth retaining them in order to be consistent with the "git
    reflog" output and to avoid users being confused about why entries are
    missing.
    
    [1] I'm not sure if this is intentional.  I've asked the Git mailing
        list: https://public-inbox.org/git/87pojmwq5y.fsf@kyleam.com/
    2a268e20
Name
Last commit
Last update
Documentation Loading commit data...
lisp Loading commit data...
t Loading commit data...
.dir-locals.el Loading commit data...
.gitignore Loading commit data...
.mailmap Loading commit data...
.travis.yml Loading commit data...
CONTRIBUTING.md Loading commit data...
COPYING Loading commit data...
ISSUE_TEMPLATE Loading commit data...
Makefile Loading commit data...
README.md Loading commit data...
default.mk Loading commit data...