git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* How to re-merge paths differently?
@ 2017-10-27 15:44 Sergey Organov
  2017-10-28 17:37 ` Philip Oakley
  0 siblings, 1 reply; 4+ messages in thread
From: Sergey Organov @ 2017-10-27 15:44 UTC (permalink / raw)
  To: git

Hello,

Is there anything like this:

$ git merge b
[... lot of conflicts ...]
$ git re-merge -X ours -- x/   # Leaves 0 conflicts in x/
$ git re-merge -X theirs -- y/ # Leaves 0 conflicts in y/
[... resolve the rest of conflicts manually ...]
$ git commit

[*] I do mean '-X' above, not '-s'.

-- Sergey

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

* Re: How to re-merge paths differently?
  2017-10-27 15:44 How to re-merge paths differently? Sergey Organov
@ 2017-10-28 17:37 ` Philip Oakley
  2017-10-28 17:50   ` Philip Oakley
  2017-10-30  5:02   ` Sergey Organov
  0 siblings, 2 replies; 4+ messages in thread
From: Philip Oakley @ 2017-10-28 17:37 UTC (permalink / raw)
  To: Sergey Organov, git

From: "Sergey Organov" <sorganov@gmail.com>
> Is there anything like this:
>
> $ git merge b
> [... lot of conflicts ...]
> $ git re-merge -X ours -- x/   # Leaves 0 conflicts in x/
> $ git re-merge -X theirs -- y/ # Leaves 0 conflicts in y/
> [... resolve the rest of conflicts manually ...]
> $ git commit
>
> [*] I do mean '-X' above, not '-s'.
>

By this I presume you mean that you have paths x and y that ate the ones 
with conflicts within them following the `git merge b`.

You then want a variant of the `git merge` command that will apply the `-X 
ours` policy *specifically to path x* so that its particular set of 
conflicts is fully resolved in favour of 'ours'.

You then want to repeat those path specific resolutions, on a path by path 
basis, to either `-X ours` or `-X theirs` until they are done.

You are also expecting that one or two conflicts will require to be fully 
manually resolved, until finally you can commit the result.

Would that be right?

Also, how do you intend to identify the 'x' and the 'y' paths, so that you 
can chose the ours/theirs/manual selection? (e.g. do you pre-know a 
regex/blob expansion)

The answer for individual paths is probably in the mergetool of your choice.
--
Philip 


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

* Re: How to re-merge paths differently?
  2017-10-28 17:37 ` Philip Oakley
@ 2017-10-28 17:50   ` Philip Oakley
  2017-10-30  5:02   ` Sergey Organov
  1 sibling, 0 replies; 4+ messages in thread
From: Philip Oakley @ 2017-10-28 17:50 UTC (permalink / raw)
  To: Philip Oakley, Sergey Organov, git

From: "Philip Oakley" <philipoakley@iee.org>
> From: "Sergey Organov" <sorganov@gmail.com>
>> Is there anything like this:
>>
>> $ git merge b
>> [... lot of conflicts ...]
>> $ git re-merge -X ours -- x/   # Leaves 0 conflicts in x/
>> $ git re-merge -X theirs -- y/ # Leaves 0 conflicts in y/
>> [... resolve the rest of conflicts manually ...]
>> $ git commit
>>
>> [*] I do mean '-X' above, not '-s'.
>>
> 
> By this I presume you mean that you have paths x and y that ate the ones 

s/ate/are/   

> with conflicts within them following the `git merge b`.
> 

[snip]

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

* Re: How to re-merge paths differently?
  2017-10-28 17:37 ` Philip Oakley
  2017-10-28 17:50   ` Philip Oakley
@ 2017-10-30  5:02   ` Sergey Organov
  1 sibling, 0 replies; 4+ messages in thread
From: Sergey Organov @ 2017-10-30  5:02 UTC (permalink / raw)
  To: Philip Oakley; +Cc: git, Philip Oakley

"Philip Oakley" <philipoakley@iee.org> writes:

> From: "Sergey Organov" <sorganov@gmail.com>
>> Is there anything like this:
>>
>> $ git merge b
>> [... lot of conflicts ...]
>> $ git re-merge -X ours -- x/   # Leaves 0 conflicts in x/
>> $ git re-merge -X theirs -- y/ # Leaves 0 conflicts in y/
>> [... resolve the rest of conflicts manually ...]
>> $ git commit
>>
>> [*] I do mean '-X' above, not '-s'.
>>
>
> By this I presume you mean that you have paths x and y that ate the
> ones with conflicts within them following the `git merge b`.

I rather mean huge amount of conflicting paths in 'x' and 'y'
subdirectories of my working tree after a merge, plus a few conflicting
paths elsewhere.

>
> You then want a variant of the `git merge` command that will apply the
> `-X  ours` policy *specifically to path x* so that its particular set of
> conflicts is fully resolved in favour of 'ours'.

Almost. I mean to apply 'ours' option to the default 'recursive' policy for
all the files that reside in the directory 'x' of my working tree and
all its subdirectories (i.e., all the paths 'x/*')

>
> You then want to repeat those path specific resolutions, on a path by
> path basis, to either `-X ours` or `-X theirs` until they are done.

No. I mean to apply '-X ours' to everything under 'x/', and '-X theirs'
to everything under 'y/'. Avoiding to repeat anything is the intention. 

> You are also expecting that one or two conflicts will require to be
> fully manually resolved, until finally you can commit the result.

No, I expect no conflicts left in either 'x/' or 'y/' after "re-merge",
as neither 'theirs' or 'ours' should leave anything unresolved, and all
the other conflicting paths (left from original merge elsewhere) I mean
to resolve manually.
 
>
> Would that be right?
>
> Also, how do you intend to identify the 'x' and the 'y' paths, so that
> you can chose the ours/theirs/manual selection? (e.g. do you pre-know
> a regex/blob expansion)

All the 'x/*' paths need 'ours', and all the 'y/*' paths need 'theirs'.

>
> The answer for individual paths is probably in the mergetool of your
> choice.

There are a lot of files under 'x/' and a lot of them under 'y/'. My
intention is to automate a lot of manual labor, and I'm not aware of a
mergetool that provides either '-X ours' or '-X theirs' resolution
automatically for all the paths specified.

-- Sergey

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

end of thread, other threads:[~2017-10-30  5:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-27 15:44 How to re-merge paths differently? Sergey Organov
2017-10-28 17:37 ` Philip Oakley
2017-10-28 17:50   ` Philip Oakley
2017-10-30  5:02   ` Sergey Organov

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).