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

Re: [PATCH] Make git-clean a builtin

From
rae l <crquan@gmail.com>
Date
Oct 7, 2007, 16:42 UTC
Message-ID
<91b13c310710070942q31cb4b5do81d1488bbd88dff@mail.gmail.com>
In-Reply-To
<20071007154126.GD5642@mediacenter.austin.rr.com>
On 10/7/07, Shawn Bohrer <shawn.bohrer@gmail.com> wrote:
Show 23 quoted lines
> Thanks for the input.
>
> On Sat, Oct 06, 2007 at 06:31:36PM -0700, Linus Torvalds wrote:
> > This looks better, but I think you'd be even better off actually using the
> > "read_directory()" interface directly, instead of exec'ing off "git
> > ls-files" and parsing the line output.
>
> Perhaps, I'll take a look at how git-ls-files does it and see if I can
> do that directly.  Since I'm new to git (and C) it will probably take me
> a while to re-implement though.
>
> > I also would still worry a bit about 'chdir(x)' and 'chdir("..")', because
> > quite frankly, they are *not* mirrors of each other (think symlinks, but
> > also error behaviour due to directories that might be non-executable).
> > Now, admittedly, if a directory isn't executable, I can imagine other git
> > things having problems (anybody want to test?), but that whole pattern is
> > just very fragile and not very reliable.
>
> Yes it does seem fragile, but 'chdir("-")' doesn't work in C and I
> couldn't find any equivalents.  I actually did think about symlinks, and
> my code does do the right thing since I test if it is a directory before
> doing the 'chdir(x)'. Symlinks are therefore treated as normal files and
> removed.

'chdir -' is just supported by the shell, and the C interface could use chdir(OLDPWD).

Previous: Shawn BohrerNext: Johannes Schindelin
Message 4 of 5 in “Make git-clean a builtin”
  1. Make git-clean a builtinShawn Bohrer, Oct 7, 2007
  2. Linus TorvaldsOct 7, 2007
  3. Shawn BohrerOct 7, 2007
  4. rae lOct 7, 2007
  5. Johannes SchindelinOct 7, 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.