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

Re: [StGit PATCH 1/5] Check for local changes with "goto"

From
Karl Hasselström <kha@treskal.com>
Date
Mar 13, 2009, 01:57 UTC
Message-ID
<20090313015755.GA15393@diana.vm.bytemark.co.uk>
In-Reply-To
<20090312120856.2992.48548.stgit@pc1117.cambridge.arm.com>
On 2009-03-12 12:08:56 +0000, Catalin Marinas wrote:
Show 6 quoted lines
> This is done by default, unless the --keep option is passed, for
> consistency with the "pop" command. The index is checked in the
> Transaction.run() function so that other commands could benefit from
> this feature (off by default).
>
> This behaviour can be overridden by setting the stgit.autokeep option.
Two small nits; otherwise,
  Acked-by: Karl Hasselström <kha@treskal.com>
> -    trans = transaction.StackTransaction(stack, 'goto')
> +    clean_iw = not options.keep and iw or None

Add some parentheses here, please! I know that "and" binds tighter than "or", but I have to think for too long to remember which is which, and I'll bet I'm not alone ...

Show 5 quoted lines
> +    def __assert_index_worktree_clean(self, iw):
> +        if not iw.worktree_clean() or \
> +           not iw.index.is_clean(self.stack.head):
> +            self.__halt('Repository not clean. Use "refresh" or '
> +                        '"status --reset"')
"Repository" is misleading here. Maybe something like
   ix_c = iw.index.is_clean(self.stack.head)
   wt_c = iw.worktree_clean()
   if not ix_c or not wt_c:
       self.__halt('%s not clean. Use "refresh" or "status --reset"'
                   % { (False, True): 'Index', (True, False): 'Worktree',
                       (False, False): 'Index and worktree' }[(ix_c, wt_c)])
-- 
Karl Hasselström, kha@treskal.com
      www.treskal.com/kalle
Previous: Catalin MarinasNext: Catalin Marinas
Message 3 of 19 in “Various StGit patches”
  1. 0/5 Various StGit patchesCatalin Marinas, Mar 12, 2009
  2. 1/5 Check for local changes with "goto"Catalin Marinas, Mar 12, 2009
  3. Karl HasselströmMar 13, 2009
  4. Catalin MarinasMar 16, 2009
  5. Karl HasselströmMar 17, 2009
  6. Catalin MarinasMar 17, 2009
  7. Karl HasselströmMar 17, 2009
  8. 2/5 Add mergetool support to the classic StGit infrastructureCatalin Marinas, Mar 12, 2009
  9. Karl HasselströmMar 13, 2009
  10. 3/5 Add automatic git-mergetool invocation to the new infrastructureCatalin Marinas, Mar 12, 2009
  11. Karl HasselströmMar 13, 2009
  12. Catalin MarinasMar 16, 2009
  13. Karl HasselströmMar 17, 2009
  14. 4/5 Convert "sink" to the new infrastructureCatalin Marinas, Mar 12, 2009
  15. Karl HasselströmMar 13, 2009
  16. 5/5 Convert "float" to the lib infrastructureCatalin Marinas, Mar 12, 2009
  17. Karl HasselströmMar 13, 2009
  18. Catalin MarinasMar 16, 2009
  19. Karl HasselströmMar 17, 2009

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.