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

Re: Possible d/f conflict bug or regression

From
Christian Couder <chriscool@tuxfamily.org>
Date
Mar 30, 2008, 04:44 UTC
Message-ID
<200803300644.15502.chriscool@tuxfamily.org>
In-Reply-To
<3e8340490803291829h6f9c39a5uf4a1b2a4e52103ca@mail.gmail.com>
Le dimanche 30 mars 2008, Bryan Donlan a écrit :
Show 16 quoted lines
> On Sat, Mar 29, 2008 at 3:13 AM, Christian Couder
> <chriscool@tuxfamily.org> wrote:
> >
> >  Initialized empty Git repository in .git/
> >  Created initial commit 3f945ca: Initial commit.
> >   0 files changed, 0 insertions(+), 0 deletions(-)
> >   create mode 100644 foo
> >  fatal: unable to index file foo
> >
> >  I think it's quite bad that it doesn't work.
>
> What behavior would you expect this to have? IMO, it's not entirely 
> clear what the user means to do if they replace a file with an empty
> directory, as an empty directory cannot be added to the index. Even
> with a directory with contents, some of the contents may be junk (.o
> for example) as far as the user is concerned.

I think Git should behave the same as when using "git rm foo" instead of "rm foo", that is the file "foo" should be deleted without errors. That's what version 1.5.3 did too.

> Would a clearer diagnostic be a good solution? Something like:
> fatal: foo: file replaced by directory.
> Use git rm --cached or git add to specify how this should be handled.

No, I think we should fix the regression. Using "git rm stuff" instead of "rm stuff" should not be required.

Regards, Christian.

Previous: Bryan DonlanNext: Bryan Donlan
Message 4 of 11 in “Possible d/f conflict bug or regression”
  1. Christian CouderMar 29, 2008
  2. Christian CouderMar 29, 2008
  3. Bryan DonlanMar 30, 2008
  4. Christian CouderMar 30, 2008
  5. Bryan DonlanMar 30, 2008
  6. Junio C HamanoMar 30, 2008
  7. 1/3 Add corner case tests for diff-index and diff-filesJunio C Hamano, Mar 31, 2008
  8. 2/3 diff-index: careful when inspecting work tree itemsJunio C Hamano, Mar 31, 2008
  9. Junio C HamanoMar 31, 2008
  10. Christian CouderMar 31, 2008
  11. 3/3 diff-files: careful when inspecting work tree itemsJunio C Hamano, Mar 31, 2008

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.