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

Re: [RFC] git-clone: add --track <headname> support

From
Junio C Hamano <junkio@cox.net>
Date
Apr 12, 2007, 10:23 UTC
Message-ID
<7vk5whki24.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<1176372539871-git-send-email-martin@catalyst.net.nz>
Martin Langhoff <martin@catalyst.net.nz> writes:
Show 19 quoted lines
> Add support for a simplified workflow where users
> want to clone and start working on a head that is
> different from the HEAD of the repository.
>
> Calling
>
>    git-clone --track maint <repo>
>
> Is equivalent to
>
>    git-clone <repo> mydir
>    cd mydir
>    git-checkout --track -b maint origin/maint
>
> --
>
> Not sure if Junio wants this, but if I am going to migrate
> away from cogito, I'd like these common operations to be
> dead simple. 
I am not interested in moving people away from cogito ;-).

With the talk about making more things built-in, I think the changes to clone and fetch should be done by first rewriting git-clone as a very thin shell wrapper that essentially does:

	figure out the directory name to use
        mkdir that directory and cd into it
        run git init with appropriate options
        run git remote add with appropriate options
        run git fetch with appropriate options
        run git checkout with appropriate options (unless -n)

Also you might want to check "branch.autosetupmerge" config. It seems to be described in git-branch manual page without being listed in Documentation/config.txt, which is a bad that happend some time ago X-<.

It seems that today has been a day to discover many bads that happened some time ago for me X-<. I should quit and call it a day now...

Previous: Martin LanghoffNext: Martin Langhoff
Message 2 of 9 in “[RFC] git-clone: add --track <headname> support”
  1. Martin LanghoffApr 12, 2007
  2. Junio C HamanoApr 12, 2007
  3. Martin LanghoffApr 12, 2007
  4. Carl WorthApr 12, 2007
  5. Martin LanghoffApr 12, 2007
  6. Carl WorthApr 12, 2007
  7. Martin LanghoffApr 12, 2007
  8. Junio C HamanoApr 13, 2007
  9. Junio C HamanoApr 13, 2007

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.