Comments (4)
@legrego That's a great idea!
Specify editor
How do you think the user should specify their editor of choice? I think it could be done in the backportrc.json config where the user also specifies their credentials, or via the standard environment variables like $EDITOR
and/or $VISUAL
.
Prompt
The prompt is definitely an option but I'm leaning towards just opening the editor, if the user has specified one (that seems like confirmation enough).
Conflicting files
After your editor has opened, how do you determine the conflicting files? I always cd
to the dir, and run git status
to get an overview, and then fix them. Perhaps the output of git status
should be displayed directly to the user, when a conflict occurs?
Finalising the conflict resolution
Currently the user is required to finalise the conflict resolution by staging and committing the changes. It would be great if the user didn't have to cd
to the directory at all anymore - but I'm not sure how to accomplish this.
One option is that backport stages and commits automatically when the user clicks "enter". This could have unforeseen consequences (if they forgot to fix a conflict, which will now be committed).
from backport.
There is currently a check to determine if the conflicting files have been staged and committed. It is not possible to continue if this check fails but I can add a confirmation prompt to let backport do this automatically:
Backporting #28692 to 6.6
✔ Pulling latest changes
✖ Cherry-picking failed. Opening your editor `code` in: /Users/larry/.backport/repositories/elastic/kibana
? Press <enter> when you have resolved the merge conflicts Yes
The following changes will be staged and committed:
--- a/animals.txt
+++ b/animals.txt
@@@ -3,3 -3,13 +3,16 @@@ canin
dog
cat
mouse
+ horse
+ spider
+ elephant
+ dinosaur
? Continue? Yes
✔ Pushing branch legrego:backport/6.6/pr-28692
✔ Creating pull request
View pull request: https://github.com/elastic/kibana/pull/28701
_Note to self:
- use
git --no-pager diff
to get the diff, andgit add -A && git commit --no-edit
to automatically staged and commit with the original commit msg_ - list conflicting files:
git --no-pager diff --name-only --diff-filter=U
- finalize cherrypick sequence:
git -c core.editor=true cherry-pick --continue
from backport.
Thank you for the thoughtful followup!
How do you think the user should specify their editor of choice? I think it could be done in the backportrc.json config where the user also specifies their credentials, or via the standard environment variables like $EDITOR and/or $VISUAL.
I'd prefer to set it in backportrc.json
, that way it's more portable. I try to avoid environment variables, but that's probably just me :)
After your editor has opened, how do you determine the conflicting files? I always cd to the dir, and run git status to get an overview, and then fix them.
VSCode has a decent git integration which automatically shows me conflicts and staged files. For me, just opening the editor at the repository path would be sufficient.
For folks that want more, maybe this configuration setting is more of a command template, where we could configure something like: code ${repoPath} && git status
?
Perhaps the output of git status should be displayed directly to the user, when a conflict occurs?
I'm not opposed to this, but if it's not too much work, maybe this is a configurable setting too? I like how concise the backport output is today, and throwing the output of git status
in the middle of that would muddy the output IMO.
Currently the user is required to finalise the conflict resolution by staging and committing the changes. It would be great if the user didn't have to cd to the directory at all anymore - but I'm not sure how to accomplish this.
One option is that backport stages and commits automatically when the user clicks "enter". This could have unforeseen consequences (if they forgot to fix a conflict, which will now be committed).
Would we be able to leverage git diff --check
to detect conflict markers before issuing the commit?
from backport.
I like your second proposal to show the diff after confirming that merge conflicts are resolved!
from backport.
Related Issues (20)
- Can this be tool used with GitLab? HOT 1
- Unexpected token . HOT 5
- v8.9.7 - Cannot read properties of undefined HOT 1
- Add support for dynamic `sourcePRLabels`
- Provide the upstream PR title as a template variable to build the backported PRs title HOT 4
- Option to copy labels from target to source HOT 5
- Workflow permission is required for pushing changes
- List of releases is out of date HOT 1
- `No target branches found for this PR` error HOT 7
- Query `CommitsByAuthor` gets 502 error in Github response when using large `maxNumber` HOT 5
- Upgrade Axios to dismiss security alerts
- Whatever I do i get a "branch is invalid or doesn't exist" HOT 8
- Support Azure DevOps HOT 7
- [Feature Request]: support draft PRs
- `sourcePullRequest.title` contains escaped characters HOT 4
- Allow setting target branches by branch name pattern
- t HOT 1
- Hitting a null object error sporadically HOT 6
- providing terminal editor during conflicts hangs the process HOT 1
- Backports opened against wrong parent PR
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from backport.