fboender/multi-git-status

"No commits yet" reported as "Uncommitted changes"

Opened this issue · 3 comments

To reproduce :

  • Create an empty git repository (git init myemptyrepo)
  • Run mgitstatus on repository
  • Bug : "Uncommitted changes" reported

$ git status

On branch master

No commits yet

nothing to commit (create/copy files and use "git add" to track)

$ mgitstatus myemptyrepo/

myemptyrepo/: Uncommitted changes

Thanks for the bug report, Oliver!

There are many edge cases in which multi-git-status shows a status that is not quite accurate. Unfortunately, git is a complex beast and adding logic for these edge cases usually just complicates matters even more.

The goal of multi-git-status is not to account for each edge case, but rather to inform the user that a repo might require some attention. I think in this case the "Uncommitted changes" communicates that well enough.

So I'm going to close this issue. If you disagree with my reasoning, feel free to reopen the issue and let me know!

thank you @fboender for your answer

Honestly, I think this specific case should be handled differently as "uncommitted changes". Because for my use case, the goal of obtaining multiple projects statuses is to quikcly know what should be done with each project. Reporting "uncommitted changes" incorrectly give the impression that something needs to be done on the repo, but this is not the case.

I saw another user had made a pullrequest with this change (#43, commits 0c83c2c, 81dd899, ...), too bad it also includes many others modification and it cannot be merged anymore.

Unfortunately I have no time for now to help you to change this. So I let you decide on this, as you are the maintainer and I completely understand your position.

@OlivierJaquemet okay, that sounds like a reasonable use-case. I've reopened this issue. I think it should be fairly simple to detect such a repo and show a different message, or perhaps don't show a message at all unless -w is specified.