[2.35 regression] sequencer, stash: fix running from worktree subdir#1205
Closed
newren wants to merge 1 commit intogit:masterfrom
Closed
[2.35 regression] sequencer, stash: fix running from worktree subdir#1205newren wants to merge 1 commit intogit:masterfrom
newren wants to merge 1 commit intogit:masterfrom
Conversation
ff7c4dd to
5847099
Compare
5847099 to
e432cf9
Compare
In commits bc3ae46 ("rebase: do not attempt to remove startup_info->original_cwd", 2021-12-09) and 0fce211 ("stash: do not attempt to remove startup_info->original_cwd", 2021-12-09), we wanted to allow the subprocess to know which directory the parent process was running from, so that the subprocess could protect it. However... When run from a non-main worktree, setup_git_directory() will note that the discovered git directory (/PATH/TO/.git/worktree/non-main-worktree) does not match DEFAULT_GIT_DIR_ENVIRONMENT (see setup_discovered_git_dir()), and decide to set GIT_DIR in the environment. This matters because... Whenever git is run with the GIT_DIR environment variable set, and GIT_WORK_TREE not set, it presumes that '.' is the working tree. So... This combination results in the subcommand being very confused about the working tree. Fix it by also setting the GIT_WORK_TREE environment variable along with setting cmd.dir. A possibly more involved fix we could consider for later would be to make setup.c set GIT_WORK_TREE whenever (a) it discovers both the git directory and the working tree and (b) it decides to set GIT_DIR in the environment. I did not attempt that here as such would be too big of a change for a 2.35.1 release. Test-case-by: Glen Choo <chooglen@google.com> Signed-off-by: Elijah Newren <newren@gmail.com>
e432cf9 to
09e1064
Compare
Contributor
Author
|
/submit |
|
Submitted as pull.1205.git.git.1643161426138.gitgitgadget@gmail.com To fetch this version into To fetch this version to local tag |
|
On the Git mailing list, Glen Choo wrote (reply to this): |
|
On the Git mailing list, Junio C Hamano wrote (reply to this): |
|
This branch is now known as |
|
This patch series was integrated into seen via 5331d2e. |
|
This patch series was integrated into seen via ce12846. |
|
This patch series was integrated into next via b2518a6. |
|
This patch series was integrated into seen via b23dac9. |
|
This patch series was integrated into next via b824226. |
|
This patch series was integrated into master via b23dac9. |
|
Closed via b23dac9. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sorry for the regression in Git 2.35; thanks for the report Glen (and Eric for feedback on earlier patches we've been bouncing back and forth that I've incorporated here)
Previous discussion thread starting over here: https://lore.kernel.org/git/kl6lilu71rzl.fsf@chooglen-macbookpro.roam.corp.google.com/ and https://lore.kernel.org/git/20220125233612.46831-1-chooglen@google.com/
cc: Glen Choo chooglen@google.com
cc: Eric Sunshine sunshine@sunshineco.com