Re: [PATCH 7/7] builtin-merge: avoid non-strategy git-merge commands in error message
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Jul 26, 2008, 15:38 UTC
- Message-ID
- <alpine.DEB.1.00.0807261737260.26810@eeepc-johanness>
- In-Reply-To
- <20080726152502.GL32057@genesis.frugalware.org>
Hi,
On Sat, 26 Jul 2008, Miklos Vajna wrote:
Show 11 quoted lines
> On Sat, Jul 26, 2008 at 05:08:11PM +0200, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> > > + memset(¬_strategies, 0, sizeof(struct cmdnames));
> > > + for (i = 0; i < main_cmds.cnt; i++) {
> >
> > Looking through all the discovered git commands? Cute... But does
> > that not exclude the commands that are in PATH, starting with
> > git-merge-, even if they are custom strategies?
>
> main_cmds contains only commands in /usr/libexec/git-core, while I guess
> custom strategies are elsewhere in PATH, which commands are in
> other_cmds, not in main_cmds.Thanks.
> - if (!strcmp(main_cmds.names[i]->name, all_strategy[j].name)) > + if (!strncmp(ent->name, all_strategy[j].name, ent->len))
Oops... that is not what I meant. You'd have to check if !all_strategy[j].name[ent->len], too...
Ciao, Dscho