Re: [StGIT PATCH 3/5] Create a git.Branch class as ancestor of stack.Stack

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2008-06-04 22:13:35 +0100, Catalin Marinas wrote:

> This class deals with Git-specific branch commands. The Stack class
> is a direct child of Branch and some of its functionality was moved
> to the new class.

Looks good except for a few minor points.

> @@ -619,3 +626,47 @@ class IndexAndWorktree(RunWithEnvCwd):
>      def update_index(self, files):
>          self.run(['git', 'update-index', '--remove', '-z', '--stdin']
>                   ).input_nulterm(files).discard_output()
> +
> +class Branch(object):
> +    """Represents Git branch."""

Missing "a".

> +    def __init__(self, repository, name):
> +        self._repository = repository
> +        self._name = name

Using double leading underscores will give you a class-local name. Why
just one?

> +    @classmethod
> +    def create(cls, repository, name, create_at = None):

Minor nit: in case of things that are clearly "owned" by other things
(git objects are owned by a git repository, for example), I've tried
to put the creation function in the owner, not the owned. I'm not
insisting, though.

> +        """Create a new Git branch and return the corresponding L{Branch} object."""

Long line.

-- 
Karl Hasselström, kha@xxxxxxxxxxx
      www.treskal.com/kalle
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux