Re: [PATCH] use natural ordering to display list of branches.
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Jun 5, 2008, 18:47 UTC
- Message-ID
- <alpine.DEB.1.00.0806051946100.21190@racer>
- In-Reply-To
- <d45085aa0806051041y42ce467fq2e07371d225ccca3@mail.gmail.com>
Hi,
On Thu, 5 Jun 2008, Cedric Vivier wrote:
Show 23 quoted lines
> Hi everyone, > > This small patch makes git display list of branches in natural order. > This way, when you name your branches against, for instance, a bug number from > some bug-tracking tool, the list will show up in a natural/human/logical order. > > Current behavior for "git branch": > BUG-1040-doing-bar-is-too-slow > BUG-84-calling-Z-with-null-segfaults > BUG-900-program-freezes-when-user-click-on-button > experimental-feature-X > master > > With the patch: > BUG-84-calling-Z-with-null-segfaults > BUG-900-program-freezes-when-user-click-on-button > BUG-1040-doing-bar-takes-too-much-time > experimental-feature-X > master > > > Signed-off-by: Cedric Vivier <cedricv@neonux.com> > ---
This is not a good commit message.
Show 9 quoted lines
> @@ -279,7 +280,7 @@ static int ref_cmp(const void *r1, const void *r2) > > if (c1->kind != c2->kind) > return c1->kind - c2->kind; > - return strcmp(c1->name, c2->name); > + return strnatcmp(c1->name, c2->name); > } > > static void print_ref_item(struct ref_item *item, int maxwidth, int verbose,
What about people preferring the status quo? I think a command line option would be in order.
Also, you _might_ want to provide a test case, so that it does not get broken by accident.
Other than that: nice.
Ciao, Dscho