Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why would a user's changes be overwritten without mention of a conflict?

Tags:

git

I am working on a two person team. I made some changes to a file called PostSet. I pushed those changes. My partner had also made changes to the same file, and even to the same query. He ran

git pull --rebase origin master

in order to put his changes on top of mine and keep the working history clean, as we always do. Normally we get conflicts if we edit the same line.

He was notified of a whole bunch of conflicts relating to some image files (a completely different issue). Just to explain everything, he fixed that problem by using

git rm -r path/to/image/dir

and then

git add -A

to add all of those changes to the index. After using

git rebase --continue

there were no more conflicts. We immediately noticed, however, that the relevant query was now using MY changes, not his. In fact, the entire file PostSet was on an old version after the rebase.

Shouldn't there have been some sort of conflict warning about the PostSet file? Is there something we did wrong with the rebase?

In short, we can't confidently continue development until we know changes will stop being overridden, so we're fairly frustrated.

Thanks a lot,

Paragon

Edit: We replicated our steps exactly and got the same result.

Edit: Given that nobody seems to have any clue, I will likely be reporting this as a bug in git. I'll leave it up for a while longer on the off chance that someone has a wild suggestion.

like image 305
Paragon Avatar asked Nov 14 '22 15:11

Paragon


1 Answers

I did the same steps using git version 1.7.3.1. After the step:

git rm -r path/to/image/dir

The file PostSet is still in conflict mode, you can verify by requesting that status (here is my output):

$ git status -s
UU PostSet
D  images/test.jpg

Now you still need to solve the conflict in PostSet. If you skip that and execute instead

git add -A 

you get the following case where git considers it as a solved conflict while you haven't actually done that:

$ git status -s
M  PostSet
D  images/test.jpg

So better to solve the conflict first and use afterwards git add -A

Or I might be missing some information here?

like image 112
Paul Pladijs Avatar answered Nov 17 '22 05:11

Paul Pladijs