Git development
 help / color / mirror / Atom feed
From: Junio C Hamano <junkio@cox.net>
To: Quy Tonthat <qtonthat@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] git-branch: deleting remote branches in new layout
Date: Sun, 17 Dec 2006 23:08:23 -0800	[thread overview]
Message-ID: <7vbqm13cm0.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <45863044.4040406@gmail.com> (Quy Tonthat's message of "Mon, 18 Dec 2006 17:08:04 +1100")

Quy Tonthat <qtonthat@gmail.com> writes:

> Now that remote branches are in refs/remotes/, branch -D needs to know
> where to find them.
>
> Signed-off-by: Quy Tonthat <qtonthat@gmail.com>

I recognize that giving end users a way to remove a "remote
tracking branch" might be a worthy goal ("update-ref -d" _could_
be used, but "branch -D" feels more natural).

> +	char ** s;
> +	static char * branches_dir[] = {"refs/heads", "refs/remotes", NULL};

But I do not like these two entries in branches_dir[].

(style: lose SP after '*' in these two lines, by the way).

If you had refs/heads/$X and refs/remotes/$X, I do not think
this code allows you to disambiguate.  You cannot remove
"remote" one without first removing the local one, can you?

> +		for (s = branches_dir; *s != NULL; s++) {
> +			name = xstrdup(mkpath("%s/%s", *s, argv[i]));
> +			if (resolve_ref(name, sha1, 1, NULL))
> +				break;
> +		}
> +		if (*s == NULL)
>  			die("Branch '%s' not found.", argv[i]);

(style: we seem to prefer "if (!*s)").

  reply	other threads:[~2006-12-18  7:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-18  6:08 [PATCH] git-branch: deleting remote branches in new layout Quy Tonthat
2006-12-18  7:08 ` Junio C Hamano [this message]
2006-12-18  7:49   ` Junio C Hamano
2006-12-18 10:02     ` Quy Tonthat
2006-12-18 13:39     ` [PATCH] (Take 2) " Quy Tonthat
2006-12-18 22:42     ` [PATCH] (Take 3) " Quy Tonthat

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=7vbqm13cm0.fsf@assigned-by-dhcp.cox.net \
    --to=junkio@cox.net \
    --cc=git@vger.kernel.org \
    --cc=qtonthat@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox