Re: Is there a way to exclude user-specified files or directories from participating in merges?

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: Is there a way to exclude user-specified files or directories from participating in merges?

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:46:13

Brent Goodrick [off-list ref] writes:
Thanks. Well, I should have said in my initial request: "Without
manually forwarding changes from branch to branch and without having
to remember special rules about what I can and cannot merge into which
branch", since that is likely to get forgotten. :)

The answer I am hearing you say is that git doesn't have a way to
automatically exclude files akin to how rsync handles include/exclude.
 Is that what you are saying? Or, could the hook mechanism be
exploited to get this behavior?
A merge is defined as a whole tree operation simply because there is no
sane way to support repeated merges (even a single direction merges)
otherwise.  What I explained was one (note that I am not saying "one true"
here) workflow that naturally supports "common version and multiple
variants" pattern that logically follows the definition of what a merge
is.

I would imagine you could define a custom merge strategy that knows to
ignore changes you made to work.sh file when you merge from work to common
(and home.sh file when you merge from home to common) to implement what
you would want, but for one thing the resulting history would not make
sense (e.g. a merge from work to central would appear as if it reverts all
the changes work made to certain files).  It would be Ok if you were using
git as a mere backup+sneakernet medium (in such a case you would not care
what the history would show you), but that is not the intended target of
git, so there is no such built-in support.

Also such a custom merge strategy would be very project specific and as
your project grows and/or as you add more deployments, I suspect its rules
will have to become a lot more complicated.  I haven't even thought about
what should happen in such a merge strategy when you try to merge work to
home.

Compared to that, the two simple rules "commit chagnes to generic things
only to the generic branch" and "merge only from generic to specific" will
not grow as your project grows complexity.

Re: Is there a way to exclude user-specified files or directories from participating in merges?

From: Brent Goodrick <hidden>
Date: 2016-06-15 22:46:14

On Tue, Feb 17, 2009 at 5:58 PM, Junio C Hamano [off-list ref] wrote:
Compared to that, the two simple rules "commit changes to generic things
only to the generic branch" and "merge only from generic to specific" will
not grow as your project grows in complexity.
I now I see the wisdom of the above statement.  You've given me a lot
of approaches to think about and try. Thanks for your help!

bg
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help