Re: [PATCH] Add support to git-branch to show local and remote branches

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

 



Andy Parkins <andyparkins@xxxxxxxxx> writes:

> Instead of storing a list of refnames in append_ref, a list of
> structures is created.  Each of these stores the refname and a
> symbolic constant representing its type.
>
> The creation of the list is filtered based on a command line
> switch; no switch means "local branches only", "-r" means
> "remote branches only" (as they always did); but now "-a"
> means "local branches or remote branches".
>
> As a side effect, the list is now not global, but allocated in
> print_ref_list() where it used.
>
> Also a memory leak is plugged, the memory allocated during the
> list creation was never freed.  This is now done in the new
> function, tidy_ref_list()

I would not call that a "leak" given that print_ref_list() is
the last thing to be called before the command exits.  I'd
rather not to spend cycles calling free().

> +static int tidy_ref_list( struct ref_list *ref_list )

Style.  No spaces before or after parameter list.

I see you already parse "refs/tags" prefix. "git branch" would
not print tags, but that part might be useful when we want to
redo git-tag in C.

Other than that, I think it is equivalent to what I have in "pu"
right now.


-
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]