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
Paul Smith <paul@mad-scientist.net>
Date
Nov 20, 2014, 15:41 UTC
Message-ID
<1416498097.23953.5.camel@mad-scientist.net>
In-Reply-To
<xmqqd28jt7tb.fsf@gitster.dls.corp.google.com>
On Wed, 2014-11-19 at 09:32 -0800, Junio C Hamano wrote:
Show 12 quoted lines
> Paul Smith <paul@mad-scientist.net> writes:
> I took a look at this again, and I do not agree with one design
> decision it makes, namely:
> 
> >> I split the creation of the directories from the symlinks: see the new
> >> loop above.  This allows us to avoid the icky dirname stuff.
> 
> which forces those who maintain the script to make sure that these
> two loops
> kept consistent with each other.  If you forget to add frotz to the
> upper loop when adding frotz/nitfol to the latter, you are breaking
> it.

Yes, but this mistake won't live past even a single attempt to run the script, since it will immediately cause a fatal error. So this doesn't bother me.

> I find it much more icky than computing what is necessary on the fly.
OK, I'll go back to the previous way.
> Aversion to turning $cleandir to an absolute path?  Why?

In some situations switching to absolute can cause unexpected behaviors, where relative paths are no longer where you expect them etc. However in this case it's not a problem: I'll change it.

Show 5 quoted lines
> These uses of --git-dir/--work-tree look somewhat funny.  You want
> to say "I want to run checkout in that $new_workdir", so say it in a
> more direct way, i.e.
> 
>     git -C "$new_workdir" checkout -f "$branch"
Good idea.
Previous: Junio C Hamano
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 18, 2014
  2. Junio C HamanoNov 18, 2014
  3. Junio C HamanoNov 19, 2014
  4. Paul SmithNov 20, 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.