oven-sh / bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
https://bun.sh
Other
74.38k stars 2.78k forks source link

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

Open Jarred-Sumner opened 10 months ago

Jarred-Sumner commented 10 months ago

Into .gitattributes:

*.lockb binary diff=lockb

Into .git/config:

[diff "lockb"]
textconv = bun
binary = true
wojtekmaj commented 10 months ago

Would be fantastic to also talk to:

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

paperdave commented 10 months ago

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)

aboqasem commented 10 months ago

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?

MRDGH2821 commented 10 months ago

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 🤔)

thecaralice commented 2 months ago

It does not "just work" because bun emits a message about loaded environment variables and screws up the pager.

image
Jarred-Sumner commented 2 months ago

It does not "just work" because bun emits a message about loaded environment variables and screws up the pager. image

that's a bug, it shouldn't be printing a message for that by default anywhere

can you file an issue?

thecaralice commented 2 months ago

@Jarred-Sumner reported in #13743