Re: [STG PATCH] refresh: add a --index option which takes the contents of the index as the new commit
- From
Karl Hasselström <kha@treskal.com>
- Date
- Jan 7, 2008, 10:56 UTC
- Message-ID
- <20080107105612.GA20981@diana.vm.bytemark.co.uk>
- In-Reply-To
- <200801022039.27611.kumbayo84@arcor.de>
On 2008-01-02 20:39:27 +0100, Peter Oberndorfer wrote:
Show 6 quoted lines
> On Sonntag 30 Dezember 2007, Peter Oberndorfer wrote: > > > Do you think this would be a useful/good idea? Or do we want a > > separate command for removing files from a patch anyway? > > The question is still open if this is useful for somebody else.
I think it's a useful addition. Thanks!
Show 24 quoted lines
> diff --git a/stgit/stack.py b/stgit/stack.py
> index 4203931..7d14261 100644
> --- a/stgit/stack.py
> +++ b/stgit/stack.py
> @@ -668,6 +668,7 @@ class Series(PatchSet):
> config.remove_section('branch.%s.stgit' % self.get_name())
>
> def refresh_patch(self, files = None, message = None, edit = False,
> + use_index = False,
> empty = False,
> show_patch = False,
> cache_update = True,
> @@ -717,6 +718,11 @@ class Series(PatchSet):
> else:
> tree_id = None
>
> + if use_index:
> + tree_id = None
> + files = None
> + cache_update = False
> +
> commit_id = git.commit(files = files,
> message = descr, parents = [bottom],
> cache_update = cache_update,So the use_index parameter to refresh_patch is actually not necessary? In that case I'd rather you didn't add it, since the functions in stgit/stack.py have quite enough parameters already.
> diff --git a/t/t2700-refresh.sh b/t/t2700-refresh.sh > index 2e7901c..9eae85d 100755 > --- a/t/t2700-refresh.sh > +++ b/t/t2700-refresh.sh
Bonus points for adding a test case!
I still haven't rebased my patch stack since Catalin accepted most of it just before Christmas. Once I've gotten around to that, I'll take your patch -- hopefully by then updated to not add the exra argument to refresh_patch(). :-)
--
Karl Hasselström, kha@treskal.com
www.treskal.com/kalle