git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tuomo Tanskanen <tuomo@tanskanen.org>
To: git@vger.kernel.org
Subject: BUG: git_work_tree issue with git alias and scripting
Date: Fri, 18 Sep 2015 10:33:44 +0300	[thread overview]
Message-ID: <CAE_UwRp7LB0E636u9cOEisMgJi3xApAVPPH_T2Hpkm43DS5F0A@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 553 bytes --]

Hello,

Attached is a simple script exposing a possible bug when git alias is
combined with git commands in script. It should be pretty self-explanatory.
Check what it does and execute it. On my Linux and OSX, both with git 2.5.1
behave the same, ie. git add fails even the file "test" is in $PWD.

Summary: $GIT_WORK_TREE persists in env, and then some git commands operate
on repo in $PWD (like git log), while some others (like git add) operate on
repo in $GIT_WORK_TREE, making it inconsistent and results in very
unexpected results.

Cheers, Tuomo

[-- Attachment #2: gitbug.sh --]
[-- Type: application/x-sh, Size: 840 bytes --]

             reply	other threads:[~2015-09-18  7:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-18  7:33 Tuomo Tanskanen [this message]
  -- strict thread matches above, loose matches on Subject: below --
2015-09-18  8:09 BUG: git_work_tree issue with git alias and scripting Tuomo Tanskanen

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

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

  git send-email \
    --in-reply-to=CAE_UwRp7LB0E636u9cOEisMgJi3xApAVPPH_T2Hpkm43DS5F0A@mail.gmail.com \
    --to=tuomo@tanskanen.org \
    --cc=git@vger.kernel.org \
    /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.
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 NNTP newsgroup(s).