git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Phillip Wood <phillip.wood@talktalk.net>
Cc: "Ondrej Mosnáček" <omosnacek@gmail.com>,
	"Philip Oakley" <philipoakley@iee.org>,
	git@vger.kernel.org
Subject: Re: git rebase -i --exec and changing directory
Date: Mon, 28 May 2018 11:45:19 +0900	[thread overview]
Message-ID: <xmqqfu2clcqo.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <3465c994-3917-cd45-bb8e-d1121f60bfb4@talktalk.net> (Phillip Wood's message of "Sun, 27 May 2018 17:07:58 +0100")

Phillip Wood <phillip.wood@talktalk.net> writes:

> I tried your recipe and got the same result as you. However I think it
> could be a problem with 'git status' rather than 'git rebase
> --exec'. If I run your recipe in /tmp/a and do
>
> cd dir
> GIT_DIR=/tmp/a/.git git status
>
> I get the same result as when running 'git status' from 'git rebase
> --exec' So I think the problem might have something to do with GIT_DIR
> being set in the environment when 'git status' is run

Yup.  

When GIT_DIR environment variable appears without GIT_WORKING_TREE,
"git" assumes that you are starting it at the root level of the
working tree.  In your example, if there is README at the top-level
but dir/README is not there, "status" would report that you removed
it.  You can unset GIT_DIR in your --exec script if you know that
Git would find the right repository when run from your script.


      parent reply	other threads:[~2018-05-28  2:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-19 16:38 git rebase -i --exec and changing directory Ondrej Mosnáček
2018-05-27 10:59 ` Ondrej Mosnáček
2018-05-27 12:28   ` Philip Oakley
2018-05-27 12:53     ` Ondrej Mosnáček
2018-05-27 16:07       ` Phillip Wood
2018-05-27 17:25         ` Philip Oakley
2018-05-27 17:25         ` Philip Oakley
2018-05-28  2:45         ` Junio C Hamano [this message]

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=xmqqfu2clcqo.fsf@gitster-ct.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=omosnacek@gmail.com \
    --cc=philipoakley@iee.org \
    --cc=phillip.wood@talktalk.net \
    /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).