Re: [PATCH 05/16] remote: remove dead code in read_branches_file()

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

 



Ramkumar Ramachandra <artagnon@xxxxxxxxx> writes:

> The first line of the function checks that the remote-name contains a
> slash ('/'), and sets the "slash" variable accordingly.  The only caller
> of read_branches_file() is remote_get_1(); the calling codepath is
> guarded by valid_remote_nick(), which checks that the remote does not
> contain a slash.  Therefore, the "slash" variable can never be set:
> remove the dead code that assumes otherwise.

This is extremely interesting.

As far as I can tell, that valid-remote-nick was done in df93e33c
(Validate nicknames of remote branches to prohibit confusing ones,
2008-02-15), and back in that version, the codepath and the feature
that wants to see a slash and do magical things, which is described
by this comment you are removing:

> -	/*
> -	 * With "slash", e.g. "git fetch jgarzik/netdev-2.6" when
> -	 * reading from $GIT_DIR/branches/jgarzik fetches "HEAD" from
> -	 * the partial URL obtained from the branches file plus
> -	 * "/netdev-2.6" and does not store it in any tracking ref.
> -	 * #branch specifier in the file is ignored.

did exist (see "git show df93e33c:remote.c").  It expects to see
"jgarzik/netdev-2.6" in remote->name, grabs the leading "jgarzik"
part to form ".git/branches/jgarzik" to open and read from, and then
appends the remainder "/netdev-2.6" to the "partial URL" it read
to come up with the final URL.

So it appears that back then (and througout to today), nobody uses
that "partial URL" feature which is specific (and was a rather nice
invention/legacy by Cogito) to .git/branches file.

Reminds me of the strategy to deprecate functionality in X (cf. 
http://lwn.net/Articles/536520/) ;-)
--
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]