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

Re: [BUG] 'stg add FILE' when FILE is a symlink to dir adds dir contents

From
CMCatalin Marinas <catalin.marinas@gmail.com>
Date
Apr 13, 2007, 23:02 UTC
Message-ID
<b0943d9e0704131602o694a46c8xb4101a05cf8ec2d3@mail.gmail.com>
In-Reply-To
<20070411155452.GL5329@moonlight.home>
On 11/04/07, Tomash Brechko <tomash.brechko@gmail.com> wrote:
> I have noticed that 'stg add FILE' works differently from 'git add
> FILE' when file is a symlink to the directory: StGIT adds the contents
> of dir, while GIT adds the symlink itself.
Thanks for this.
> But curious, why does the code traverse the tree itself?  Why not to
> give the file list directly to git-update-index, and let it decide
> what files to add, and how?

Because this code was implemented almost 2 years ago when I don't think git-update-index was able to scan directories. Never looked at re-implementing it.

> I also guess the code doesn't honor .gitignore.

It doesn't, unless git-update-index ignores the files passed on the command line according to the .gitignore content.

> Could 'names' list be passed to git-update-index directly?
Probably, I'll give it a try and see whether it breaks anything.
-- 
Catalin
Previous: Karl Hasselström
Message 3 of 3 in “[BUG] 'stg add FILE' when FILE is a symlink to dir adds dir contents”
  1. Tomash BrechkoApr 11, 2007
  2. Karl HasselströmApr 12, 2007
  3. Catalin MarinasApr 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.