bun icon indicating copy to clipboard operation
bun copied to clipboard

Add `.gitattributes` and `.git/config` in `bun init` to make `git diff` just work for bun.lockb files

Open Jarred-Sumner opened this issue 1 year ago • 3 comments

Into .gitattributes:

*.lockb binary diff=lockb

Into .git/config:

[diff "lockb"]
textconv = bun
binary = true

Jarred-Sumner avatar Jan 19 '24 04:01 Jarred-Sumner

Would be fantastic to also talk to:

  • GitHub
  • Gitlab
  • Azure DevOps
  • npm, Yarn, pnpm

maintainers to update the defaults set as you create repo with them.

wojtekmaj avatar Jan 19 '24 10:01 wojtekmaj

is .git/config synced to the remote. if not, then writing to it will cause a very confusing situation where one developers git environment is different from another without obvious reason why (they wont realize .git/config is written to)

paperclover avatar Jan 20 '24 12:01 paperclover

is .git/config synced to the remote. if not, then writing to it will cause a very confusing situation where one developers git environment is different from another without obvious reason why (they wont realize .git/config is written to)

Yeah this is where I was unsure, since .git/config is untracked, one would lose the config if cloned the inited project later.

For me, I add a .gitconfig file to the repo.

Should we generate a .gitconfig and then include it in .git/config?

[include]
path = ../.gitconfig

Or just add a postinstall script: git config --local include.path ../.gitconfig?

aboqasem avatar Jan 22 '24 17:01 aboqasem

Would be great if VSCode extension also gets this upgrade. The diff shows up like this: image

(This section may not show any difference, but those do exist at the bottom of this but my point is that VSCode is not highlighting which lines have difference. Maybe I'm naive because I do not know the internal working of this matter 🤔)

MRDGH2821 avatar Jan 27 '24 16:01 MRDGH2821