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

Allow override temp file location in git cp #1090

Closed
weiw005 opened this issue Oct 19, 2023 · 5 comments
Closed

Allow override temp file location in git cp #1090

weiw005 opened this issue Oct 19, 2023 · 5 comments

Comments

@weiw005
Copy link
Contributor

weiw005 commented Oct 19, 2023

When running git cp it will create a temp file following a certain convention.

E.g. running git cp a/b/c.kt d/e.kt will create a temp file like this: a__b__c.kt-move-to-d__e.kt

While this behavior works most of the time, it may run into path-too-long error when the src/dest file path is very deep.

Suggestion: allow a third parameter to specify a temp file location override.

@spacewander
Copy link
Collaborator

PR is welcome!

@MattiasEh
Copy link
Contributor

@spacewander Would you like a PR from main...MattiasEh:git-extras:main ? That approach avoids the need for a messy temporary file and therefore eliminates the class of problems that includes this issue. It also makes for a cleaner history (at least IMHO) and should affect the original branch atomically.

My changes seem to work well for me, but I don't have a great way to test regressions for this fairly significant approach-change. What's the best way to move forward?

References:

@spacewander
Copy link
Collaborator

@MattiasEh
Thanks for your work on this. Would you submit a pull request?

@MattiasEh
Copy link
Contributor

Happy to! PR #1169 created.

@spacewander
Copy link
Collaborator

Consider solved.

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

No branches or pull requests

3 participants