git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jacob Keller <jacob.e.keller@intel.com>
To: git@vger.kernel.org
Cc: Jacob Keller <jacob.keller@gmail.com>
Subject: [PATCH] rebase: exec leaks GIT_DIR to environment
Date: Fri, 27 Oct 2017 17:01:52 -0700	[thread overview]
Message-ID: <20171028000152.2760-1-jacob.e.keller@intel.com> (raw)

From: Jacob Keller <jacob.keller@gmail.com>

I noticed a failure with git rebase interactive mode which causes "exec"
commands to be run with GIT_DIR set. When GIT_DIR is in the environment,
then any command which results in running a git command in
a subdirectory will fail because GIT_DIR=".git".

This unfortunately breaks one of my project's Makefiles, which uses
git-describe to find the version information, but does so from within
a sub directory.

I'm in the process of running a bisect to find where this got
introduced, but I suspect it's part of the rebase--helper changes that
happened a while ago.

Signed-off-by: Jacob Keller <jacob.keller@gmail.com>
---
 t/t3404-rebase-interactive.sh | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh
index 3704dbb2ecf6..60ab5136f702 100755
--- a/t/t3404-rebase-interactive.sh
+++ b/t/t3404-rebase-interactive.sh
@@ -108,6 +108,17 @@ test_expect_success 'rebase -i with the exec command runs from tree root' '
 	rm -fr subdir
 '
 
+test_expect_failure 'rebase -i with the exec git commands in subdirs still work' '
+	test_when_finished "rm -ff subdir" &&
+	test_when_finished "git rebase --abort" &&
+	git checkout master &&
+	mkdir subdir && (cd subdir &&
+	set_fake_editor &&
+	FAKE_LINES="1 exec_>cd_subdir_&&_git_rev-parse_--is-inside-work-tree" \
+		git rebase -i HEAD^
+	)
+'
+
 test_expect_success 'rebase -i with the exec command checks tree cleanness' '
 	git checkout master &&
 	set_fake_editor &&
-- 
2.11.1.4.gad8c7cd


             reply	other threads:[~2017-10-28  0:02 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-28  0:01 Jacob Keller [this message]
2017-10-28 16:00 ` [PATCH] rebase: exec leaks GIT_DIR to environment Johannes Schindelin
2017-10-28 22:35   ` Jacob Keller
2017-10-29 18:34   ` Phillip Wood
2017-10-30  2:26     ` Junio C Hamano
2017-10-30  2:53       ` Jacob Keller
2017-10-30  3:36         ` Junio C Hamano
2017-10-30  6:26           ` Jacob Keller
2017-10-30 10:20             ` Phillip Wood
2017-10-30 12:46               ` Johannes Schindelin
2017-10-31  8:13                 ` Jacob Keller
2017-10-30  2:51     ` Jacob Keller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171028000152.2760-1-jacob.e.keller@intel.com \
    --to=jacob.e.keller@intel.com \
    --cc=git@vger.kernel.org \
    --cc=jacob.keller@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).