* git-merge ignore specific files
@ 2007-11-06 12:38 Bill Priest
2007-11-06 12:53 ` Andreas Ericsson
2007-11-06 13:03 ` Jakub Narebski
0 siblings, 2 replies; 5+ messages in thread
From: Bill Priest @ 2007-11-06 12:38 UTC (permalink / raw)
To: git
All,
I have two branches that are slightly different and
most changes "belong" in both. There are a handful of
files/directories that are disparate. Is there any
way in git to tell it not to merge these files? Kind
of like .gitignore but for merges.
In addition I'd like a way to specify to git-merge
to leave all merged files unrecorded in the index.
Then as I go through each file making sure that the
merge "makes sense" (not that git did the right thing;
but that I want the changes in both branches) that I
add the change to the index.
I'm sure that I'm probably using git "incorrectly"
and I welcome suggestions for modifying my workflow to
a git style.
Any and all suggestions greatly appreciated,
Bill
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: git-merge ignore specific files
2007-11-06 12:38 git-merge ignore specific files Bill Priest
@ 2007-11-06 12:53 ` Andreas Ericsson
2007-11-06 13:03 ` Jakub Narebski
1 sibling, 0 replies; 5+ messages in thread
From: Andreas Ericsson @ 2007-11-06 12:53 UTC (permalink / raw)
To: Bill Priest; +Cc: git
Bill Priest wrote:
> All,
> I have two branches that are slightly different and
> most changes "belong" in both. There are a handful of
> files/directories that are disparate. Is there any
> way in git to tell it not to merge these files? Kind
> of like .gitignore but for merges.
> In addition I'd like a way to specify to git-merge
> to leave all merged files unrecorded in the index.
> Then as I go through each file making sure that the
> merge "makes sense" (not that git did the right thing;
> but that I want the changes in both branches) that I
> add the change to the index.
> I'm sure that I'm probably using git "incorrectly"
> and I welcome suggestions for modifying my workflow to
> a git style.
>
> Any and all suggestions greatly appreciated,
>
At a cursory glance at the sources, it looks as if you should be able to
get what you want with pretty small modifications to builtin-read-tree.c
and git-merge.sh.
Specifically, 'git read-tree' (which does the heavy lifting during merges)
takes --exclude-per-directory as an argument. You want to teach 'git merge'
to do the same and pass that argument along to 'git read-tree'. Then it's
just a matter of maintaining two sets of .gitignore files, one of which
you'd probably want to call .mergeignore (or something) and make sure you
don't forget to pass that option when you merge (although I assume you'd
notice if you'd forgotten it during conflict resolution).
--
Andreas Ericsson andreas.ericsson@op5.se
OP5 AB www.op5.se
Tel: +46 8-230225 Fax: +46 8-230231
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: git-merge ignore specific files
2007-11-06 12:38 git-merge ignore specific files Bill Priest
2007-11-06 12:53 ` Andreas Ericsson
@ 2007-11-06 13:03 ` Jakub Narebski
2007-11-06 13:15 ` Bill Priest
1 sibling, 1 reply; 5+ messages in thread
From: Jakub Narebski @ 2007-11-06 13:03 UTC (permalink / raw)
To: git
Bill Priest wrote:
> All,
> I have two branches that are slightly different and
> most changes "belong" in both. There are a handful of
> files/directories that are disparate. Is there any
> way in git to tell it not to merge these files? Kind
> of like .gitignore but for merges.
Most probably you can use gitattributes for that.
Or you can use 'our' merge strategy.
> In addition I'd like a way to specify to git-merge
> to leave all merged files unrecorded in the index.
> Then as I go through each file making sure that the
> merge "makes sense" (not that git did the right thing;
> but that I want the changes in both branches) that I
> add the change to the index.
You can use gitattributes for that.
--
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: git-merge ignore specific files
2007-11-06 13:03 ` Jakub Narebski
@ 2007-11-06 13:15 ` Bill Priest
2007-11-06 13:46 ` Jakub Narebski
0 siblings, 1 reply; 5+ messages in thread
From: Bill Priest @ 2007-11-06 13:15 UTC (permalink / raw)
To: Jakub Narebski, git
--- Jakub Narebski <jnareb@gmail.com> wrote:
> Bill Priest wrote:
>
> > All,
> > I have two branches that are slightly different
> and
> > most changes "belong" in both. There are a
> handful of
> > files/directories that are disparate. Is there
> any
> > way in git to tell it not to merge these files?
> Kind
> > of like .gitignore but for merges.
>
> Most probably you can use gitattributes for that.
> Or you can use 'our' merge strategy.
Can you point me to some docs on "our" merge strategy?
>
> > In addition I'd like a way to specify to
> git-merge
> > to leave all merged files unrecorded in the index.
>
> > Then as I go through each file making sure that
> the
> > merge "makes sense" (not that git did the right
> thing;
> > but that I want the changes in both branches) that
> I
> > add the change to the index.
>
> You can use gitattributes for that.
I did man gitattributes and nothing jumped out at me
as far as an attribute that I could set/unset that
would stop a file from being merged. What am I
missing?
Bill
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: git-merge ignore specific files
2007-11-06 13:15 ` Bill Priest
@ 2007-11-06 13:46 ` Jakub Narebski
0 siblings, 0 replies; 5+ messages in thread
From: Jakub Narebski @ 2007-11-06 13:46 UTC (permalink / raw)
To: Bill Priest; +Cc: git
Bill Priest wrote:
> Jakub Narebski <jnareb@gmail.com> wrote:
>> Bill Priest wrote:
>>
>>> All,
>>> I have two branches that are slightly different and
>>> most changes "belong" in both. There are a handful of
>>> files/directories that are disparate. Is there any
>>> way in git to tell it not to merge these files? Kind
>>> of like .gitignore but for merges.
>>
>> Most probably you can use gitattributes for that.
>> Or you can use 'our' merge strategy.
>
> Can you point me to some docs on "our" merge strategy?
git-merge(1), section "Merge strategies":
ours::
This resolves any number of heads, but the result of the
merge is always the current branch head. It is meant to
be used to supersede old development history of side
branches.
>>> In addition I'd like a way to specify to git-merge
>>> to leave all merged files unrecorded in the index.
>>> Then as I go through each file making sure that the
>>> merge "makes sense" (not that git did the right thing;
>>> but that I want the changes in both branches) that
>>> I add the change to the index.
>>
>> You can use gitattributes for that.
>
> I did man gitattributes and nothing jumped out at me
> as far as an attribute that I could set/unset that
> would stop a file from being merged. What am I
> missing?
See `diff' and `merge' attributes, for example
*.nbi -diff -merge
--
Jakub Narebski
Poland
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2007-11-06 13:46 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-06 12:38 git-merge ignore specific files Bill Priest
2007-11-06 12:53 ` Andreas Ericsson
2007-11-06 13:03 ` Jakub Narebski
2007-11-06 13:15 ` Bill Priest
2007-11-06 13:46 ` Jakub Narebski
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).