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

Re: [PATCH] git-new-workdir: Don't fail if the target directory is empty

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 21, 2014, 17:33 UTC
Message-ID
<xmqqegsw1msr.fsf@gitster.dls.corp.google.com>
In-Reply-To
<1416582517.23953.18.camel@mad-scientist.net>
Paul Smith <paul@mad-scientist.net> writes:
Show 8 quoted lines
>> Why these changes?  I thought you are making sure $cleandir is
>> absolute so that you do not have to do this and can just "cd" into
>> the new working tree, the same way the user would do once it is set
>> up.
>
> I made cleandir absolute mainly because you asked me to :-).  I didn't
> realize that the implication behind that request was that I'd put back
> the original "cd" as well.

This is about not changing unnecessarily the original that has been battle-tested and keeping the result resistant to future mistakes (i.e. somebody going elsewhere without realizing a relative cleandir will cause problems). Once $cleandir is fixed, there no longer is a good reason to change how HEAD is pointed in the $new_workdir or its working tree populated; the change in the earlier round in that area was necessary when $cleandir was not absolute, but not anymore.

Previous: Paul Smith
Message 4 of 4 in “git-new-workdir: Don't fail if the target directory is empty”
  1. git-new-workdir: Don't fail if the target directory is emptyPaul Smith, Nov 20, 2014
  2. Junio C HamanoNov 20, 2014
  3. Paul SmithNov 21, 2014
  4. Junio C HamanoNov 21, 2014

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.