Re: [PATCH 3/5] clone: find the current branch more explicitly

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

 



On Sun, Nov 30, 2008 at 01:57:30AM -0800, Junio C Hamano wrote:

> +			sym = find_ref_by_name(refs, symref);
> +			if (!sym) {
> +				/*
> +				 * NEEDSWORK: perhaps create the symref ref
> +				 * that is still unborn and queue it?
> +				 */
> +				continue;
> +			}

I don't see any reason not to create the pointer to an unborn branch. I
think it would be nice eventually to allow cloning an empty repository
(i.e., to facilitate:

  mkdir foo &&
  (cd foo && git --bare init) &&
  git clone foo bar &&
  cd bar &&
  echo content >file && git add file && git commit -m content &&
  git push

) which people have asked for from time to time.

> +			if (sym->symref)
> +				die("symref line says %s points at %s "
> +				    "but earlier it said it points at %s",
> +				    symref, target, sym->symref);

I wonder if there would ever be a use for sending multiple symref
packets for the same ref. IOW, should we "be liberal in what we accept"
here and just choose some sane behavior (like picking the first or last
to be sent), and allow room for expansion there.

I can't actually think of a possible use for that, but nor can I think
of any particular reason to die here (save for detecting bugs in
upload-pack :) ). But just consider that we will be stuck with clients
with the "die" behavior forever.

-Peff
--
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