From: Catalin Marinas <catalin.marinas@gmail.com>
To: "Karl Hasselström" <kha@treskal.com>
Cc: git@vger.kernel.org
Subject: Re: [StGit PATCH] Check for local changes with "goto"
Date: Fri, 6 Feb 2009 18:39:47 +0000 [thread overview]
Message-ID: <b0943d9e0902061039g37eb521fl26d60d33c45a206@mail.gmail.com> (raw)
In-Reply-To: <20090206153106.GA28897@diana.vm.bytemark.co.uk>
2009/2/6 Karl Hasselström <kha@treskal.com>:
> On 2009-02-06 14:46:19 +0000, Catalin Marinas wrote:
>
>> 2009/1/30 Catalin Marinas <catalin.marinas@gmail.com>:
>>
>> > Now, should we add the check_clean argument to
>> > Transaction.__init__() rather than run() as we do for the
>> > allow_bad_head case?
>>
>> It looks like this may be a better option.
>
> Sorry for taking so long to respond, but ... I strongly advise against
> using default_iw in transaction.py. It's library code, and it should
> take stuff like index and worktree as input parameters from layers
> that are higher up in the abstraction stack.
OK, no problem with that.
>> The previous patch fails if "goto" pushes a patch with standard
>> git-apply followed by another patch with a three-way merge. When
>> Transaction.run() is called, even if the patch pushing succeeded,
>> the function complains about local changes because of the
>> "iw.index.is_clean(self.stack.head)" check.
>
> Hmm, so that would have to be worked around somehow ... I guess doing
> the check in __init__() might make sense after all, since that's
> before we start changing things. How about adding a
> check_clean_relative_to paramter to __init__() that's not a boolean,
> but an iw to check against? It would default to None, meaning no
> check.
OK, that's better.
>> It is also a bit weird to push/pop patches and only complain at the
>> end of local changes.
>
> You mean the behavior the new infrastructure currently gives you? It's
> actually convenient in a number of cases. Assume for example that you
> have patch A that changes file foo, patch B that changes file bar, and
> then local changes to file bar. At this point you can pop A without
> problem, even though a middle stage is to pop and push B which touches
> the same file as your local changes -- the existing checks will only
> compare the diff between the original and final tree with your local
> changes, and that diff doesn't contain bar.
Yes, I agree that's a nice feature and it would still be available
with the --keep option (I wrote in the past why I wouldn't leave the
current behaviour to be the default).
Above I was referring to the new behaviour which checks for local
changes by default (--keep not passed). If we do the test in run() you
may push or pop patches and only fail at the end when actually the
operation shouldn't have started. I plan to add the auto interactive
merging to the new infrastructure (by invoking mergetool if
IndexAndWorktree.merge() fails, based on the stgit.autoimerge option)
and pushing may become a more complex operation if enabled.
I'll repost the patch. Thanks.
--
Catalin
next prev parent reply other threads:[~2009-02-06 18:41 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-28 23:13 [StGit PATCH] Check for local changes with "goto" Catalin Marinas
2009-01-29 3:45 ` Karl Hasselström
2009-01-30 14:01 ` Catalin Marinas
2009-01-30 15:26 ` Karl Hasselström
2009-01-30 17:36 ` Catalin Marinas
2009-02-06 14:46 ` Catalin Marinas
2009-02-06 15:31 ` Karl Hasselström
2009-02-06 18:39 ` Catalin Marinas [this message]
-- strict thread matches above, loose matches on Subject: below --
2009-02-10 14:11 Catalin Marinas
2009-02-11 9:05 ` Karl Hasselström
2009-01-14 22:59 Catalin Marinas
2009-01-15 8:37 ` Karl Hasselström
2009-01-15 22:24 ` Catalin Marinas
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=b0943d9e0902061039g37eb521fl26d60d33c45a206@mail.gmail.com \
--to=catalin.marinas@gmail.com \
--cc=git@vger.kernel.org \
--cc=kha@treskal.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).