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

Re: [StGIT PATCH 3/5] Add stack creation and initialisation support to lib.Stack

From
Karl Hasselström <kha@treskal.com>
Date
Jun 7, 2008, 09:30 UTC
Message-ID
<20080607093051.GE32647@diana.vm.bytemark.co.uk>
In-Reply-To
<20080606204554.8805.37257.stgit@localhost.localdomain>
On 2008-06-06 21:45:54 +0100, Catalin Marinas wrote:
> This patch adds the create and initialise Stack classmethods to handle
> the initialisation of StGIT patch series on a Git branch.
>
> Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
Acked-by: Karl Hasselström <kha@treskal.com>
I still have some comments, bu the patch looks good as-is.
Show 7 quoted lines
> +    @staticmethod
> +    def create(stackdir):
> +        """Create the PatchOrder specific files
> +        """
> +        utils.create_empty_file(os.path.join(stackdir, 'applied'))
> +        utils.create_empty_file(os.path.join(stackdir, 'unapplied'))
> +        utils.create_empty_file(os.path.join(stackdir, 'hidden'))

Maybe s/create/create_files/ or soething to that effect here, as I suggested in another mail a few minutes ago.

Show 5 quoted lines
> +    def set_parents(self, remote, branch):
> +        if remote:
> +            self.set_parent_remote(remote)
> +        if branch:
> +            self.set_parent_branch(branch)

Much clearer now. Interesting that the only reason we need this function at all is to make sure that set_parent_remote and set_parent_branch are called in the correct order.

Maybe set_parent_branch should throw an exception instead of silently doing nothing when there is no parent yet? It would force the callers to be more aware of the limitation -- though we might not actually want that. Your call.

-- 
Karl Hasselström, kha@treskal.com
      www.treskal.com/kalle
Previous: Catalin MarinasNext: Catalin Marinas
Message 7 of 12 in “Proposed patches”
  1. 0/5 Proposed patchesCatalin Marinas, Jun 6, 2008
  2. 1/5 Rename Repository.head to Repository.head_refCatalin Marinas, Jun 6, 2008
  3. Karl HasselströmJun 7, 2008
  4. 2/5 Create a git.Branch class as ancestor of stack.StackCatalin Marinas, Jun 6, 2008
  5. Karl HasselströmJun 7, 2008
  6. 3/5 Add stack creation and initialisation support to lib.StackCatalin Marinas, Jun 6, 2008
  7. Karl HasselströmJun 7, 2008
  8. Catalin MarinasJun 8, 2008
  9. 4/5 Convert "init" to the new StGIT infrastructureCatalin Marinas, Jun 6, 2008
  10. Karl HasselströmJun 7, 2008
  11. 5/5 Add test_patches target to MakefileCatalin Marinas, Jun 6, 2008
  12. Karl HasselströmJun 7, 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.