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

Re: Possible minor bug in Git

From
Torsten Bögershausen <tboegi@web.de>
Date
Jan 31, 2019, 20:34 UTC
Message-ID
<20190131203447.aovalz2vzsjpdjdv@tb-raspi4>
In-Reply-To
<CAHYHVP+Dvbq_aOMy1_Kq0LHJsd4r+4GiP3N3R4A9ouAoJ4gw9g@mail.gmail.com>
On Thu, Jan 31, 2019 at 09:29:28AM +0200, Angelo Melonas wrote:
Show 25 quoted lines
> Just to clarify, I made a mistake above. Instead of "untracked", I
> meant "unstaged".
> I apologise for the confusion.
>
> On Thu, Jan 31, 2019 at 9:01 AM Angelo Melonas <angelomelonas@gmail.com> wrote:
> >
> > Good day,
> >
> > I found a potential bug in Git for Windows. The bug can be reproduced
> > as follows:
> >
> > 1. Modify a file so that it shows up as "untracked" when executing the
> > "git status" command.
> > 2. Attempt to "git add" the file, but change the case of a single
> > letter. The command executes but no warning or error is displayed.
> > 3. Execute "git status" again and it still shows the file as "untracked".
> >
> > Please let me know if I am mistaken. I also have a screenshot
> > demonstrating the "bug" which I cannot attach to this email, but which
> > can be requested.
> >
> > Have a great day.
> >
> > Kind regards,
> > Angelo Melonas

See the example below, Git tracks AA.txt, so you must run git add AA.txt

After a commit, you can tell Git that the file was renamed: git mv AA.txt Aa.txt (and then a commit)

------------------------------
user@mac:/tmp/tt2> git init
Initialized empty Git repository in /private/tmp/tt2/.git/
user@mac:/tmp/tt2> echo AAA > AA.txt
user@mac:/tmp/tt2> git add AA.txt
user@mac:/tmp/tt2> git commit -m AA.txt
[master (root-commit) f102760] AA.txt
 1 file changed, 1 insertion(+)
  create mode 100644 AA.txt
  user@mac:/tmp/tt2> echo BB >AA.txt
  user@mac:/tmp/tt2> mv AA.txt  Aa.txt
  user@mac:/tmp/tt2> git status
  On branch master
  Changes not staged for commit:
    (use "git add <file>..." to update what will be committed)
      (use "git checkout -- <file>..." to discard changes in working directory)
        modified:   AA.txt
no changes added to commit (use "git add" and/or "git commit -a")
user@mac:/tmp/tt2> git add AA.txt
user@mac:/tmp/tt2> git status
On branch master
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)
        modified:   AA.txt
user@mac:/tmp/tt2>
Previous: Angelo MelonasNext: Angelo Melonas
Message 3 of 10 in “Possible minor bug in Git”
  1. Angelo MelonasJan 31, 2019
  2. Angelo MelonasJan 31, 2019
  3. Torsten BögershausenJan 31, 2019
  4. Angelo MelonasFeb 1, 2019
  5. Torsten BögershausenFeb 2, 2019
  6. Giuseppe CrinòFeb 6, 2019
  7. Johannes SchindelinFeb 7, 2019
  8. Torsten BögershausenFeb 8, 2019
  9. Philip OakleyFeb 9, 2019
  10. Giuseppe Crino'Feb 10, 2019

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.