All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: martin f krafft <madduck@madduck.net>
Cc: Jay Soffian <jaysoffian@gmail.com>, git@vger.kernel.org
Subject: Re: [PATCH v2] builtin-branch: improve output when displaying remote branches
Date: Thu, 12 Feb 2009 23:36:45 -0800	[thread overview]
Message-ID: <7viqneeqk2.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <20090213064707.GA17681@piper.oerlikon.madduck.net> (martin f. krafft's message of "Fri, 13 Feb 2009 07:47:07 +0100")

martin f krafft <madduck@madduck.net> writes:

> also sprach Junio C Hamano <gitster@pobox.com> [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*.

  reply	other threads:[~2009-02-13  7:38 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-10 11:01 [PATCH] builtin-branch: improve output when displaying remote branches Jay Soffian
2009-02-11  6:47 ` Jay Soffian
2009-02-12  3:49 ` Junio C Hamano
2009-02-12  4:30   ` Jay Soffian
2009-02-12  5:42     ` Junio C Hamano
2009-02-13  5:34       ` [PATCH v2] " Jay Soffian
2009-02-13  6:35         ` Junio C Hamano
2009-02-13  6:45           ` Jay Soffian
2009-02-13  7:52             ` Junio C Hamano
2009-02-13  8:06               ` Jay Soffian
2009-02-13  9:40                 ` [PATCH v3] " Jay Soffian
2009-02-13  6:47           ` [PATCH v2] " martin f krafft
2009-02-13  7:36             ` Junio C Hamano [this message]
2009-02-13  7:37         ` Johannes Sixt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7viqneeqk2.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=jaysoffian@gmail.com \
    --cc=madduck@madduck.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.