git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pete Wyckoff <pw@padd.com>
To: Luke Diamand <luke@diamand.org>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 00/12] git p4: submit conflict handling
Date: Fri, 17 Aug 2012 08:21:34 -0400	[thread overview]
Message-ID: <20120817122134.GA29257@padd.com> (raw)
In-Reply-To: <502DDEF5.4090405@diamand.org>

luke@diamand.org wrote on Fri, 17 Aug 2012 07:04 +0100:
> On 17/08/12 00:35, Pete Wyckoff wrote:
> >These patches rework how git p4 deals with conflicts that
> >arise during a "git p4 submit".  These may arise due to
> >changes that happened in p4 since the last "git p4 sync".
> >
> >Luke: I especially wanted to get this out as you suggested
> >that you had a different way of dealing with skipped commits.
> >
> >The part that needs the most attention is the interaction
> >loop that happens when a commit failed.  Currently, three
> >options are offered:
> >
> >     [s]kip this commit, but continue to apply others
> >     [a]pply the commit forcefully, generating .rej files
> >     [w]rite the commit to a patch.txt file
> >     and the implicit<ctrl-c>  to stop
> >
> >After this series, it offers two:
> >
> >     [c]ontinue to apply others
> >     [q]uit to stop
> >
> >This feels more natural to me, and I like the term "continue" rather
> >than "skip" as it matches what rebase uses.  I'd like to know what
> >others think of the new flow.
> 
> The skip is still needed. In my workflow, git-p4 gets run
> periodically and does the usual sync+rebase on behalf of all the
> people who have pushed to the git repo.
> 
> If someone pushes a change which conflicts with something from
> Perforce land, then what I want to happen is for the script to
> discard the offending commit (git rebase --skip) and then carry on
> with the others.
> 
> In 99% of cases this does exactly what I need, as conflicting
> commits are usually caused by people committing the same fix to both
> p4 and git at around the same time (someone breaks top-of-tree with
> an obvious error, two separate people check in slightly different
> fixes). Discarding the git commit then means that everything carries
> on working.
> 
> I've got a small patch which makes skipping work non-interactively;
> the thing it's missing is reporting the commits which are skipped.

This "discard offending commits" part I had not thought anyone
would ever do.  Instead, why not do "git p4 rebase" on its own
and use "git rebase --skip" to discard the offending ones
explicitly.  It seems dangerous to do it implicitly as part
of a multi-commit submit to p4.

Thanks for sending your RFC work.  I see what you are thinking
about.

Assuming that it really would be good to have a way to
_automatically_ discard conflicting commits, then sure, keeping a
list in submit and plumbing that into the rebase would work.  It
still scares me.  There are quite a few special cases where it
fails, of course, like if future commits involve dependencies on
the one you want to skip.

Would this alternative approach work: "git p4 submit
--discard-conflicting-commits" (and/or the option).  It
automatically hits "skip" after every submit failure.  When done,
it does "git p4 sync" to get a report on what ended up in tree.
Then instead of rebasing, the HEAD is simply taken to the top of
the p4 tree.  No need to rebase if the rule is to discard all
skipped patches.  Plus some reporting to say what was lost.

I will reroll my series once we've figured out how we want these
to co-exist.

		-- Pete

      reply	other threads:[~2012-08-17 12:21 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-16 23:35 [PATCH 00/12] git p4: submit conflict handling Pete Wyckoff
2012-08-16 23:35 ` [PATCH 01/12] git p4 test: remove bash-ism of combined export/assignment Pete Wyckoff
2012-08-17  3:08   ` Junio C Hamano
2012-08-16 23:35 ` [PATCH 02/12] git p4 test: use p4d -L option to suppress log messages Pete Wyckoff
2012-08-17  6:07   ` Luke Diamand
2012-08-16 23:35 ` [PATCH 03/12] git p4: gracefully fail if some commits could not be applied Pete Wyckoff
2012-08-17  6:53   ` Johannes Sixt
2012-08-17 11:49     ` Pete Wyckoff
2012-08-17  7:21   ` Luke Diamand
2012-08-17 11:58     ` Pete Wyckoff
2012-08-16 23:35 ` [PATCH 04/12] git p4: remove submit failure options [a]pply and [w]rite Pete Wyckoff
2012-08-16 23:35 ` [PATCH 05/12] git p4: move conflict prompt into run, use [c]ontinue and [q]uit Pete Wyckoff
2012-08-16 23:35 ` [PATCH 06/12] git p4: standardize submit cancel due to unchanged template Pete Wyckoff
2012-08-16 23:35 ` [PATCH 07/12] git p4: test clean-up after failed submit, fix added files Pete Wyckoff
2012-08-16 23:35 ` [PATCH 08/12] git p4: rearrange submit template construction Pete Wyckoff
2012-08-16 23:35 ` [PATCH 09/12] git p4: revert deleted files after submit cancel Pete Wyckoff
2012-08-16 23:35 ` [PATCH 10/12] git p4: accept -v for --verbose Pete Wyckoff
2012-08-16 23:35 ` [PATCH 11/12] git p4: add submit --dry-run option Pete Wyckoff
2012-08-16 23:35 ` [PATCH 12/12] git p4: add submit --prepare-p4-only option Pete Wyckoff
2012-08-17  6:04 ` [PATCH 00/12] git p4: submit conflict handling Luke Diamand
2012-08-17 12:21   ` Pete Wyckoff [this message]

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=20120817122134.GA29257@padd.com \
    --to=pw@padd.com \
    --cc=git@vger.kernel.org \
    --cc=luke@diamand.org \
    /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).