git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chris Packham <judge.packham@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: GIT <git@vger.kernel.org>
Subject: Re: re-running merge on a single file
Date: Fri, 12 Mar 2010 15:43:03 -0800	[thread overview]
Message-ID: <a038bef51003121543t52a864ddlab345dd1bcf6c906@mail.gmail.com> (raw)
In-Reply-To: <7v3a05p29w.fsf@alter.siamese.dyndns.org>

On Fri, Mar 12, 2010 at 3:07 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Chris Packham <judge.packham@gmail.com> writes:
>
>> ... I'm lazy and my
>> projects rules allow broken commits so ...
>
> We cannot fix, nor it is our job to fix, lazy people or undisciplined
> projects ;-)

Fair call. I don't think the maintainers of human-nature-v1.0 are
interested in patches :)

Actually on another note wasn't there an idea of being able to say
that a particular set of commits is known to break bisect-ability?
Ideally I'd want one commit that comprises the merge from upstream, at
this point the build targets from upstream should build happily but
the targets we've added we know are broken. Then I come along and fix
the targets we've added, maybe doing commits sub system by sub system
to make review easy. Finally whatever work is left to actually make
our targets build successfully is in another commit. From a bisect
point of view I'd want to say that the merge and sub system commits
are intentional breakages and that bisect should really look at this
whole series as a single uber commit. I guess this is information that
could go into notes that bisect could then take into account when
making its next jump.

> Having said that you can still retry your merge, which was _mostly_ Ok.
>
>  (1) First, check out the original commit before the merge.  You may have
>     built a few more commits on top of it, so "git log --first-parent"
>     may help to find that commit.  Suppose you found that merge commit
>     and we call that $merge; then:
>
>     $ git checkout $merge^1
>
>  (2) Then you retry that merge:
>
>     $ git merge $merge^2
>
>     which would conflict the same way you saw.
>
>  (3) If you have rerere enabled, then the conflicts would be already
>     resolved in your working tree at this point, but not in the index, so
>     you can reproduce the conflicted state with "checkout -m".

Mental note: Need to learn more about git rerere. Sounds like what I
need to do the job.

>  (4) If you didn't have rerere enabled, then you would have a lot of
>     conflicted files in the working tree.  Inspect them by comparing with
>     $merge:
>
>     $ git diff $merge
>
>     Since we are assuming that most of the resolution was good, and you
>     know what paths you want to fix your earlier resolution for, you
>     would want to take what is in $merge for most of the paths.  You can
>     run checkout on paths that you know were good in $merge, like so:
>
>     $ git checkout $merge -- include/ drivers/
>
>     and repeat this step to narrow it down to the paths you are
>     interested in.
>
>  (5) After you fix the resolution and make a commit,
>
>     $ git diff $merge
>
>     will show that your earlier incorrect resolution is replaced by a new
>     correct resolution.
>
> After that, you can rebase your branch on top of HEAD to conclude.
>
> Note that recent git can use "checkout -m path" to reproduce conflicts
> even after you ran "git add path".

OK I'll look out for that in future. This won't be the last time I'm
doing a big merge.

  reply	other threads:[~2010-03-12 23:43 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-11 18:54 re-running merge on a single file Chris Packham
2010-03-11 19:09 ` Chris Packham
2010-03-11 20:29 ` Markus Heidelberg
2010-03-11 22:08   ` Chris Packham
2010-03-11 23:20     ` Jakub Narebski
     [not found]       ` <a038bef51003111631n38f7e50cp79d8335109f3ed0@mail.gmail.com>
2010-03-12  0:33         ` Chris Packham
2010-03-12  6:45           ` Johannes Sixt
2010-03-12  6:56             ` Junio C Hamano
2010-03-12 20:16               ` Chris Packham
2010-03-12 21:16                 ` Chris Packham
2010-03-12 23:07                 ` Junio C Hamano
2010-03-12 23:43                   ` Chris Packham [this message]
2010-03-14 12:24                     ` Kris Shannon
2010-03-12  9:00           ` Jakub Narebski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a038bef51003121543t52a864ddlab345dd1bcf6c906@mail.gmail.com \
    --to=judge.packham@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).