Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to decode git status change code for chunk [ A .envrc ] #86

Open
jackbashford opened this issue Feb 13, 2025 · 2 comments
Open
Labels

Comments

@jackbashford
Copy link

This occurs fairly frequently, I use direnv and this means I have .envrc files in my directories. However, running gs then gives me the message:

2025/02/13 15:43:23
Failed to decode git status change code for chunk: [ A .envrc]
Please file a bug including this error message as well as the output of:

git status --porcelain

You can file the bug at: https://github.com/mroth/scmpuff/issues/

Output of git status --porcelain:

 A .envrc
 A devenv.lock
 A flake.lock
 A flake.nix
?? .devenv.flake.nix
?? .devenv/
?? .direnv/
?? devenv.nix
?? devenv.yaml

Contents of .envrc are "use flake":

❯ hexdump .envrc
0000000 7375 2065 6c66 6b61 0a65
000000a
@mroth
Copy link
Owner

mroth commented Feb 13, 2025

Interesting, the issue here is not the filename but rather the [ A] git status change code, which used to not exist but was seemingly added to git at some point. (In your porcelain example, it's crashing on the first file it encounters with that status).

From the git status documentation when scmpuff was written:

   X          Y     Meaning
   -------------------------------------------------
             [MD]   not updated

But currently I now see in the git status documentation (https://git-scm.com/docs/git-status#_short_format) that same status is possible with a A in the second field:

X          Y     Meaning
-------------------------------------------------
	 [AMD]   not updated

It should be relatively straightforward to update the parser to handle this case (though there are a bunch more new cases I see in that documentation too, so longer term #33 is probably the direction I'd like to update this project with), but I'm also curious how you get a git directory into the status where that code shows up, since I haven't encountered it before.

@mroth mroth added the bug label Feb 13, 2025
@jackbashford
Copy link
Author

Here is a command log from me creating and having this issue:

$ mkdir scmpuff-test
$ cd scmpuff-test
$ git init
$ git branch -m main
$ nix flake new . -t templates#utils-generic
$ gs

If I can give any more environment issue to help diagnose the source of the new file status, let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants