New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set dummy merge driver merge ours .gitattributes. #751

Merged
merged 1 commit into from Aug 6, 2014

Conversation

Projects
None yet
2 participants
@cirosantilli
Contributor

cirosantilli commented Apr 28, 2014

People don't know that they must set the ours driver in order for the merge=ours to work, or else Git silently ignores their inexistent driver.

The confusion is even greater considering that ours is a valid option to merge -s recursive -X ours

I have seen this on two SO questions in which the OP explicitly mentions progit:

http://stackoverflow.com/questions/5465122/gitattributes-individual-merge-strategy-for-a-file
http://stackoverflow.com/questions/14093540/tell-git-to-use-ours-merge-strategy-on-specific-files

and it catches me every time I move machines.

@jnavila

This comment has been minimized.

Member

jnavila commented Apr 28, 2014

It seems to be a recurring problem and your solution does not seem to address all the cases. In case one branch did not modify the file since the fork, then merging would still overwrite the unchanged file because Git would find a fast-forward instead of a 3 way merge.

@cirosantilli

This comment has been minimized.

Contributor

cirosantilli commented Apr 28, 2014

Thanks for that info, I had no idea. Is there a technique that also covers that case?

@jnavila

This comment has been minimized.

Member

jnavila commented Apr 28, 2014

Good question. I have no idea also.

@jnavila

This comment has been minimized.

Member

jnavila commented Apr 28, 2014

At least, something needs to be done on this part of the book. As it is now, it's plainly wrong.

@jnavila

This comment has been minimized.

Member

jnavila commented Aug 6, 2014

As is, this change is better than nothing.

jnavila added a commit that referenced this pull request Aug 6, 2014

Merge pull request #751 from cirosantilli/attributes-merge-ours-confi…
…g-driver

Set dummy merge driver merge ours .gitattributes.

@jnavila jnavila merged commit 91103b2 into progit:master Aug 6, 2014

1 check passed

continuous-integration/travis-ci The Travis CI build passed
Details

@cirosantilli cirosantilli deleted the cirosantilli:attributes-merge-ours-config-driver branch Aug 7, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment