feat!(Paket.restore.targets): Support `dotnet restore` without `paket restore`; avoid null git diffs
Nobody has claimed this yet.
- Dominant language
- F#
- Stars
- 2.1k
- Forks
- 528
- Avg merge
- 1d 12m
- Merged PRs (30d)
- 54
Description
Context
- Paket referenced via
dotnet.tools.json(v 7.2.1); sameversionspec inpaket.dependencies - per what I believe to be common practice, I specify
* text=autoin.gitattributes; 99% of files are thus LF endings
Description
The paket docs don't provide a pit of success for the combo of:
- using git
- being able to
dotnet restoreordotnet buildfrom a clean clone (orgit clean -fdx) - NOT having to run
dotnet paket restore(asdotnet restoreseems to include it and Just Work as long a thePaket.restore.targetsfile is present)
Expected behavior
- Never end up with line-ending only diffs in git
- Never have to invoke
paket restore
Actual behavior
- If/when I edit/merge
Paket.restore.targets, the line endings change to LF - If/when I
paket installetc, the file is replaced with a CRLF-endings based file - If I don't commit `Paket.restore.targets, restore does not work without a paket restore
Desired behavior/crazy ideas
I'd be very happy to be told about the xyproblem.info nature of my reasoning and told a better solution, but I feel I've definitely done the legwork to try to figure this out!
I see the following potential general directions to resolve the issue:
- Add a doc section that covers what to do (atm it has many generations of advice, but nothing that suggests that it's currently a good idea to add
Paket.restore.targetsto your repo). I would propose to add some version of the Known Workarounds below to the docs. - Tweak Paket's behavior in minor ways. e.g.
- if it figured out the expected line endings and wrote paket.restore.targets per that ?
- if
paket autorestoreprinted a message recommending to commit thePaket.restore.targets?
- Do a more complete fix or V8, e.g.
- Have a
/paket.targetsin base of repo (with line endings per.gitattributes) - Update the docs to say to commit
/paket.* - Either have Paket autorestore put a CRLF override in the .gitattributes, or respect the repo's rules
I'd be prepared to do solution 1 if I get enough input
I am not sufficiently au fait with current gen paket to do solution 2
I don't realistically have bandwidth to contribute to the impl of solution 3, though I'll obviously test and type here.
Known workarounds
(Assuming typical gitattributes with typical * text=auto in effect)
- Add
.paket/Paket.restore.targets eol=crlfto.gitattributes - Add
.paket/Paket.restore.targetsto source control (with CRLF line endings)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the Paket documentation sections covering dotnet restore, Paket.restore.targets, autorestore, and the listed gitattributes workarounds. Compare the existing guidance with the reported clean-clone and line-ending behavior; done should mean the docs clearly explain whether to commit the generated targets file and how to avoid null git diffs without invoking paket restore.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git
- Domain
- build-system, documentation
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100