git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Add option -b/--branch to clone for select a new HEAD

From
Jeff King <peff@peff.net>
Date
Aug 25, 2009, 19:00 UTC
Message-ID
<20090825190039.GD23731@coredump.intra.peff.net>
In-Reply-To
<1251220806-17607-1-git-send-email-catap@catap.ru>

Thanks for revising, it is looking a bit better. A few comments still, though:

On Tue, Aug 25, 2009 at 09:20:06PM +0400, Kirill A. Korinskiy wrote:
Show 5 quoted lines
> Sometimes (especially on production systems) we need to use only one
> remote branch for building software. It really annoying to clone
> origin and then swith branch by hand everytime. So this patch provide
> functionality to clone remote branch with one command without using
> checkout after clone.
Typos:
  s/It/It's/
  s/swith/switch/
  s/provide/provides/
  s/clone remote/clone a remote/
>  t/t5706-clone-brnach.sh     |   31 +++++++++++++++++++++++++++++++
Typo: s/brnach/branch/ :)
Show 13 quoted lines
> +test_expect_success 'clone' '
> +
> +	git clone parent clone &&
> +	(cd clone && git rev-parse --verify refs/remotes/origin/master)
> +
> +'
> +
> +test_expect_success 'clone -b' '
> +
> +	git clone -b two parent clone-b &&
> +	(cd clone && git rev-parse --verify refs/remotes/origin/two)
> +
> +'

Is this really testing the right thing? Shouldn't you always have refs/remotes/origin/*, no matter what "-b" says? The difference should be that HEAD in the first test will point to 'master', and to 'two' in the second test.

-Peff
Previous: Kirill A. KorinskiyNext: Kirill A. Korinskiy
Message 5 of 6 in “Add option -b/--branch to clone for select a new HEAD”
  1. Add option -b/--branch to clone for select a new HEADKirill A. Korinskiy, Aug 24, 2009
  2. Jeff KingAug 25, 2009
  3. Junio C HamanoAug 25, 2009
  4. Add option -b/--branch to clone for select a new HEADKirill A. Korinskiy, Aug 25, 2009
  5. Jeff KingAug 25, 2009
  6. Add option -b/--branch to clone for select a new HEADKirill A. Korinskiy, Aug 25, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.