git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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
Previous: Peter OberndorferNext: Karl Hasselström
Message 3 of 7 in “[STGIT] stg refresh wish (splitting patches/removing files from a patch)”
  1. Peter OberndorferDec 30, 2007
  2. refresh: add a --index option which takes the contents of the index as the new commitPeter Oberndorfer, Jan 2, 2008
  3. Karl HasselströmJan 7, 2008
  4. Karl HasselströmJan 7, 2008
  5. add a --index option to refresh which takes the contents of the index as the new commitPeter Oberndorfer, Jan 8, 2008
  6. Karl HasselströmJan 9, 2008
  7. Karl HasselströmJan 10, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.