git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Trouble with file specific merge strategies
@ 2012-03-10 23:47 suvayu ali
  2012-03-11  8:57 ` Junio C Hamano
  0 siblings, 1 reply; 7+ messages in thread
From: suvayu ali @ 2012-03-10 23:47 UTC (permalink / raw)
  To: git

Hi git devs,

I have a repo with two branches where some files are absent in one of
the branches. Say the two branches are <allfiles> and <somefiles>. Until now
I was using

$ git merge -s ours <allfiles> # with <somefiles> checked out

to merge commits which touches the absent files. But this clutters up
history and is very inconvenient to do sometimes. So when I came across
the possibility of using .gitattributes for file specific merge
strategies, I tried the following:

pattern merge=ours

However I get the following conflict message:

CONFLICT (rename/delete): org-mode-config.el deleted in HEAD and
renamed in 74288bb. Version 74288bb of org-mode-config.el left in
tree.

This file was deleted from <somefiles> in the past[1] and was renamed in
<allfiles> since the last merge. I was expecting this file to be ignored
(or in other words, merged with ours) since the .gitattributes file has
entries like these:

org-mode-config.el	   merge=ours  # new name in allfiles branch
lisp/org-mode-settings.el  merge=ours  # old name deleted in somefiles

I also see other new files in <allfiles> which are mentioned in
.gitattributes being merged in <somefiles>.

$ git status -sb
## somefiles
M  abbrev_defs
A  cpp-config.el
A  email-config.el                 # <-- this should be ignored
A  gui-config.el                   # <-- this should be ignored
UU init.el
A  keybindings.el
M  lisp/skeletons.el
D  lisp/text-mode-like-settings.el
UA org-mode-config.el              # <-- this should be ignored
A  text-mode-config.el

What am I doing wrong here? My git version is 1.7.7.6.

Thanks in advance,


Footnotes:

[1] There has been several successful merges since then.

-- 
Suvayu

Open source is the future. It sets us free.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-03-11 18:02 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-10 23:47 Trouble with file specific merge strategies suvayu ali
2012-03-11  8:57 ` Junio C Hamano
2012-03-11 10:10   ` suvayu ali
2012-03-11 11:18     ` Junio C Hamano
2012-03-11 11:27       ` suvayu ali
2012-03-11 15:17       ` Thomas Hochstein
2012-03-11 18:01         ` suvayu ali

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).