Re: [PATCH v2] builtin-branch: improve output when displaying remote branches

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

 



martin f krafft <madduck@xxxxxxxxxxx> writes:

> also sprach Junio C Hamano <gitster@xxxxxxxxx> [2009.02.13.0735 +0100]:
>> Once you start making each case arm do more things, it might make sense to
>> rewrite the above unrolled loop into something like this:
> [...]
>> 	} ref_kind[] = {
>>         	{ REF_LOCAL_BRANCH, "refs/heads/", 11 },
>>         	{ REF_REMOTE_BRANCH, "refs/remotes/", 13 },
>> 	};
> [...]
>
>> Then we can later add new elements more easily, e.g.
>> 
>>                 { REF_TOPGIT_BASE, "refs/top-base/", 14 },
>
> As soon as TopGit is integrated into Git proper, this could make
> sense. However, I don't know when this will happen. In the mean
> time, hardcoding extensions like you suggest might not scale too
> well. Wouldn't it make more sense to provide an interface that
> allowed tools to register their own namespaces, and handle those
> appropriately within Git?

The comment applies to the way how ref_kind[] array is initialized, and
yes it would be nicer to make it extensible once the code that uses the
array is in palce.

However, the codepath that uses the array once it is initialized will not
have to change, if you add your interface to register namespaces.

That is why I suggested the code restructuring first *with* the known two
hierarchies we know we would want to handle *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]

  Powered by Linux