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

Re: Teach git-update-index about gitlinks

From
Alex Riesen <raa.lkml@gmail.com>
Date
Apr 13, 2007, 07:42 UTC
Message-ID
<81b0412b0704130042k1f5be3bay30cbbb6b70259f6@mail.gmail.com>
In-Reply-To
<Pine.LNX.4.64.0704121218130.4061@woody.linux-foundation.org>
On 4/12/07, Linus Torvalds <torvalds@linux-foundation.org> wrote:
Show 5 quoted lines
> +static int process_lstat_error(const char *path, int err)
> +{
> +       if (err == ENOENT || err == ENOTDIR)
> +               return remove_one_path(path);
> +       return error("lstat(\"%s\"): %s", path, strerror(errno));
You forgot to change errno to err in strerror.
> +static int add_one_path(struct cache_entry *old, const char *path, int len, struct stat *st)
...
Show 6 quoted lines
>         option = allow_add ? ADD_CACHE_OK_TO_ADD : 0;
>         option |= allow_replace ? ADD_CACHE_OK_TO_REPLACE : 0;
>         if (add_cache_entry(ce, option))
> -               return error("%s: cannot add to the index - missing --add option?",
> -                            path);
> +               return error("%s: cannot add to the index - missing --add option?", path);

return error("%s: cannot add to the index%s", path, "\0 - missing --add option?" + !allow_add); is be nicer. We really do know whether "--add" was passed or not.

> + *    (NOTE! This is old and arguably fairly strange behaviour.
> + *    We might want to make this an error unconditionally, and
> + *    use "--force-remove" if you actually want to force removal).
...
> +               /* Should this be an unconditional error? */
> +               return remove_one_path(path);

Makes me uncomfortable too. Is it be possible anyone is depending on it? Maybe it still can be changed?

Previous: Linus TorvaldsNext: Alex Riesen
Message 4 of 5 in “Teach git-update-index about gitlinks”
  1. Linus TorvaldsApr 12, 2007
  2. Junio C HamanoApr 12, 2007
  3. Linus TorvaldsApr 12, 2007
  4. Alex RiesenApr 13, 2007
  5. Alex RiesenApr 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.