threads / discuss / 49705

Lost changes after merge

Subject: Lost changes after merge

## tl;dr

6 messages between Oct 29, 2018 and Oct 31, 2018.

replies: 5people: 4as markdown or json

Gray King· Oct 29, 2018, 08:49 UTC · lore
Hello,
  I have a very strange issue described below:
* Here is the tree before I merge via `git log --format="%h %p %d" -n
20 --all --graph`:
https://upaste.de/9Pe
* Here is the output of `git log --format="%h %p %d" -2 path/to/file`:

a008c4d580 c61f96eb5d a274b6e7ca 67c1000ca3

* Here is the merge commands:

git merge f087081868 # fix conflicts

* Here is the tree after I merged via `git log --format="%h %p %d" -n
20 --all --graph`:
https://upaste.de/8Bx
* Here is the output of `git log --format="%h %p %d" -2 path/to/file`:

a274b6e7ca 67c1000ca3 67c1000ca3 00bd5c8c89

Gray King· Oct 29, 2018, 08:51 UTC · re: Gray King · lore

Re: Lost changes after merge

After merged, the latest commit(a008c4d580) has lost and the second commit(a274b6e7ca) has been the latest, and changes missed too.

在 2018年10月29日 下午4:49:20, Gray King (grayking.w@gmail.com(mailto:grayking.w@gmail.com)) 写到:

Show 29 quoted lines
>
>
> Hello,
>
> I have a very strange issue described below:
>
> * Here is the tree before I merge via `git log --format="%h %p %d" -n 20 --all --graph`:
>
> https://upaste.de/9Pe
>
> * Here is the output of `git log --format="%h %p %d" -2 path/to/file`:
>
> a008c4d580 c61f96eb5d
> a274b6e7ca 67c1000ca3
>
> * Here is the merge commands:
>
> git merge f087081868
> # fix conflicts
>
> * Here is the tree after I merged via `git log --format="%h %p %d" -n 20 --all --graph`:
>
> https://upaste.de/8Bx
>
>
> * Here is the output of `git log --format="%h %p %d" -2 path/to/file`:
>
> a274b6e7ca 67c1000ca3
> 67c1000ca3 00bd5c8c89
Jeff King· Oct 29, 2018, 14:18 UTC · re: Gray King · lore

Re: Lost changes after merge

On Mon, Oct 29, 2018 at 09:49:20AM +0100, Gray King wrote:
Show 8 quoted lines
> Hello,
> 
>   I have a very strange issue described below:
> 
> * Here is the tree before I merge via `git log --format="%h %p %d" -n
> 20 --all --graph`:
> 
> https://upaste.de/9Pe

FWIW, neither this nor the other paste link in your email seem to work for me (which makes it hard to comment on the rest of the email).

-Peff
Gray King· Oct 30, 2018, 02:46 UTC · re: Jeff King · lore

Re: Lost changes after merge

Sorry, seems the link has been expired, here is the new one:
* Before merge run `git log --format="%h %p %d" -n 20 --all --graph`:
https://cfp.vim-cn.com/cbfq6
* After merged run `git log --format="%h %p %d" -n 20 --all --graph`:
https://cfp.vim-cn.com/cbfq7
在 2018年10月29日 下午10:18:07, Jeff King (peff@peff.net(mailto:peff@peff.net)) 写到:
Show 15 quoted lines
> On Mon, Oct 29, 2018 at 09:49:20AM +0100, Gray King wrote:
>
> > Hello,
> >
> > I have a very strange issue described below:
> >
> > * Here is the tree before I merge via `git log --format="%h %p %d" -n
> > 20 --all --graph`:
> >
> > https://upaste.de/9Pe
>
> FWIW, neither this nor the other paste link in your email seem to work
> for me (which makes it hard to comment on the rest of the email).
>
> -Peff
Rafael Ascensão· Oct 30, 2018, 15:29 UTC · re: Gray King · lore

Re: Lost changes after merge

The commits you mentioned are not present on the new pastes.
On Tue, Oct 30, 2018 at 03:46:28AM +0100, Gray King wrote:
> Sorry, seems the link has been expired, here is the new one:
> * Before merge run `git log --format="%h %p %d" -n 20 --all --graph`:
>

One thing I noticed, is that you're using %p with --graph. And --graph enables parent rewriting. Which may surprise you if you don't know what it does.

But apart from that, and assuming you only did `git merge f087081868` everything looks normal between those two pastes.

Cheers, Rafael Ascensão

Brandon McCaig· Oct 31, 2018, 15:30 UTC · re: Gray King · lore

Re: Lost changes after merge

Gray:
On Tue, Oct 30, 2018 at 03:46:28AM +0100, Gray King wrote:
Show 7 quoted lines
> * Before merge run `git log --format="%h %p %d" -n 20 --all --graph`:
> 
> https://cfp.vim-cn.com/cbfq6
> 
> * After merged run `git log --format="%h %p %d" -n 20 --all --graph`:
> 
> https://cfp.vim-cn.com/cbfq7

I also cannot see anything wrong here. The two commits you mentioned earlier are not in either paste, as was already stated. It might help us understand if you are more explicit about what you think is wrong. Maybe verify that your pastes have captured all of the necessary information to understand the problem.

The only other thing that I note is that 6d6ed669d1 and 3c792ffaf0 appear to be merging the same two parents, so logically they should be identical (unless merge conflicts were resolved in different ways). Is that related to the issue? Was one of the merges done incorrectly, and you're trying to fix it? Or are you just confused about how you got into this state in the first place?

Regards,
-- 
Brandon McCaig <bamccaig@gmail.com> <bambams@castopulence.org>
Castopulence Software <https://www.castopulence.org/>
Blog <http://www.bambams.ca/>
perl -E '$_=q{V zrna gur orfg jvgu jung V fnl. }.
q{Vg qbrfa'\''g nyjnlf fbhaq gung jnl.};
tr/A-Ma-mN-Zn-z/N-Zn-zA-Ma-m/;say'

← back to recent threads