jj icon indicating copy to clipboard operation
jj copied to clipboard

Gitattr eol design

Open 06393993 opened this issue 2 months ago • 5 comments

The example implementation can be found at https://github.com/06393993/jj/compare/gitattr-eol-example-impl%5E...gitattr-eol-example-impl.

Checklist

If applicable:

  • [ ] I have updated CHANGELOG.md
  • [ ] I have updated the documentation (README.md, docs/, demos/)
  • [ ] I have updated the config schema (cli/src/config-schema.json)
  • [ ] I have added/updated tests to cover my changes

06393993 avatar Nov 10 '25 16:11 06393993

@yuja before I start to work on this feature, do we agree that we really want more EOL conversion related features in jj, especially the text gitattributes and the eol gitattributes support? Given that you thought EOL conversion is a mistake in VCS, and should be implemented at an entire different layer out side the VCS software. If we don't think we should not add such feature, I am Ok to drop the work and leave details in the document on why we don't such features in jj. Thanks.

06393993 avatar Nov 10 '25 16:11 06393993

do we agree that we really want more EOL conversion related features in jj, especially the text gitattributes and the eol gitattributes support?

I don't understand how gitattributes works exactly, but we'll have to support some of them for Git interop. I'm not against adding something that enables EOL conversion conditionally based on paths (e.g. *.jpg -text.)

yuja avatar Nov 11 '25 02:11 yuja

Hi all, I think this design is ready for review. Please comment on the questions left in the Open questions section if you have opinions to those questions. I will adjust the design accordingly. Thanks!

06393993 avatar Nov 18 '25 19:11 06393993

Do we need more detailed description in the Prior work section?

I don't believe so, since it's just implementation and not architecture the links should be enough context.

icorbrey avatar Nov 18 '25 19:11 icorbrey

TODO after this change is merged:

  • [ ] File an issue for gitattributes diff support.
  • [ ] File an issue for gitattributes merge support.
  • [ ] File an issue for git add --renormalize support.
  • [ ] File an issue for per-backend default on working-copy.eol-conversion-use-gitattributes.
  • [ ] File an issue on external diff tool and merge tool support.
  • [ ] File an issue on how conversion should be applied: before the conflicts are materialized and apply the conversion on multiple sides, or apply once on the materialized conflict with the conflict marker.

06393993 avatar Nov 27 '25 05:11 06393993