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

Put worktree outside of repo in manual steps #5

Merged
merged 2 commits into from
Oct 28, 2022

Conversation

andrross
Copy link

@andrross andrross commented Oct 26, 2022

If a backport fails then steps are given to create a backport manually. Currently, these steps put the worktree inside the repository folder, which causes git to see the worktree as untracked files. This change puts the worktree outside of the repository to avoid this problem.

Signed-off-by: Andrew Ross andrross@amazon.com

Check List

  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Vacha Shah <vachshah@amazon.com>
If a backport fails then steps are given to create a backport manually.
Currently, these steps put the worktree inside the repository folder,
which causes git to see the worktree as untracked files. This change
puts the worktree outside of the repository to avoid this problem.

Signed-off-by: Andrew Ross <andrross@amazon.com>
@VachaShah VachaShah merged commit c0583b1 into VachaShah:main Oct 28, 2022
@rursprung
Copy link

i just realised that there's a serious problem with this and would suggest to either amend it or revert the commit: i presume that most people - like me - have their OpenSearch repositories in the same folder. and all of them share the same branch names for release branches. this means, that if i'm doing manual backports based on this guide for the same releases in multiple OpenSearch repositories it'll try to use the same folder name for the worktrees of different repositories.

so the guide should probably add the repository name to the backport folder (either as a subfolder: ../.worktrees/${reponame}/backport-${base} or just as part of the folder name: ../.worktrees/backport-${reponame}-${base}).

and another problem (unrelated to this PR): the script never validates where it is and the guide doesn't explicitly say that you should run it from the base folder of the repository. if you run it from anywhere else (any subfolder within the repo) your folder will end up elsewhere. this could probably be solved using git rev-parse --show-toplevel (haven't had to use that one before, but found it online :)). when you run basename on that in turn you'll get the name of the folder of the repo (which is usually the repo name unless the developer chose another name for his local clone - but that doesn't matter: it's unique, we can use it for the worktree name as well).

@andrross andrross mentioned this pull request Nov 1, 2022
1 task
@andrross
Copy link
Author

andrross commented Nov 1, 2022

@rursprung Created another PR here: #7

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

Successfully merging this pull request may close these issues.

3 participants