Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 346350 - Rebase writes incomplete reflog and leaves empty lines in reflog
Summary: Rebase writes incomplete reflog and leaves empty lines in reflog
Status: RESOLVED FIXED
Alias: None
Product: JGit
Classification: Technology
Component: JGit (show other bugs)
Version: 1.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 3.0.2   Edit
Assignee: Robin Rosenberg CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-18 18:24 EDT by Dariusz Luksza CLA
Modified: 2013-08-26 02:26 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dariusz Luksza CLA 2011-05-18 18:24:24 EDT
I've recently check my reflog and is teams that jgit puts empty lines there.

Here are examples:
2cb3fec HEAD@{5}: checkout: moving from refs/heads/introduce-synchronize-workspace-action to 2cb3fecefec914f0621c143469a47597e4fcee4f
efe8c2c HEAD@{6}: 
efe8c2c HEAD@{7}: commit: [sync] Add 'Synchronize Workspace' action
2cb3fec HEAD@{8}: 
a44bac5 HEAD@{9}: commit (amend): [sync] Add 'Synchronize Workspace' action


...

c65e869 HEAD@{18}: commit: Extract branch name comparator into utility class
642fcf9 HEAD@{19}: commit: [sync] Include additional refs in destination branch list
afd2c7f HEAD@{20}: commit: [sync] Improve UX in synchronize wizard
9eb81e6 HEAD@{21}: 
2a8886e HEAD@{22}: 
c62af64 HEAD@{23}: 
2a8886e HEAD@{24}: checkout: moving from refs/heads/include-FETCH_HEAD-in-wizard to 2a8886e1b5c5604ff79c6e81cbab9351b6b5fd0c
c62af64 HEAD@{25}: 
c62af64 HEAD@{26}: commit: [sync] Order alphabetically rev names in sync-wizard
ba8ee9a HEAD@{27}: commit: Extract branch name comparator into utility class
Comment 1 Robin Rosenberg CLA 2011-05-21 11:16:57 EDT
rebase does this. In the reflog for HEAD it write an additional entry with an empty message and same old and new SHA-1 ids.

98b019f4bdc45bd122e4d81009c4e814350e051c 40fa75feb4536218a59b4cb6ea71e3579c8000dd Robin Rosenberg <robin.rosenberg@dewire.com> 1305990897 +0200	
40fa75feb4536218a59b4cb6ea71e3579c8000dd 40fa75feb4536218a59b4cb6ea71e3579c8000dd Robin Rosenberg <robin.rosenberg@dewire.com> 1305990897 +0200
Comment 2 Dariusz Luksza CLA 2011-11-25 15:37:17 EST
(In reply to comment #1)
> rebase does this. In the reflog for HEAD it write an additional entry with an
> empty message and same old and new SHA-1 ids.

True RebaseCommand in method checkoutCommit() creates an RefUpdate objcts, then sets expected and new object id but don't set ref log message. Is this operation really needed here ?
Comment 3 Tomasz Zarna CLA 2012-11-02 16:31:15 EDT
(In reply to comment #2)
> True RebaseCommand in method checkoutCommit() creates an RefUpdate objcts,
> then sets expected and new object id but don't set ref log message. Is this
> operation really needed here ?

fwiw, once I'm done with https://git.eclipse.org/r/#/c/8394/ we should be able to put up a test comparing JGit Reflog with its native counterpart. This is going to answer your question and give you a failing or passing test depending on the answer.
Comment 4 Robin Rosenberg CLA 2013-05-04 17:57:41 EDT
Patch at https://git.eclipse.org/r/12517
Comment 5 Chris Aniszczyk CLA 2013-07-21 23:03:00 EDT
Fixed in master.

60e01cff2f763a85ed24a706d26eb9f159ffa832
Comment 6 Matthias Sohn CLA 2013-08-26 02:26:24 EDT
cherry-picked for 3.0.2