git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Martin Nicolay <m.nicolay@osm-ag.de>
To: git@vger.kernel.org
Subject: bug: setting GIT_DIR to $(git rev-parse --git-dir) changes behavior
Date: Thu, 25 Feb 2021 15:54:27 +0100 (CET)	[thread overview]
Message-ID: <alpine.LSU.2.20.2102251549330.20742@cpza.bfz-tzou.qr> (raw)

Thank you for filling out a Git bug report!
Please answer the following questions to help us understand your issue.

What did you do before the bug happened? (Steps to reproduce your issue)

$ env | grep GIT
$ git --version
git version 2.30.1
$ git init t
Initialized empty Git repository in /tmp/t/.git/
$ mkdir t/foo
$ cd t/foo
$ git rev-parse --show-toplevel
/tmp/t
$ GIT_DIR=$(git rev-parse --git-dir) git rev-parse --show-toplevel
/tmp/t/foo
$ git rev-parse --git-dir
/tmp/t/.git

What did you expect to happen? (Expected behavior)

"git rev-parse --show-toplevel" should be the same in both invocation.

What happened instead? (Actual behavior)

"git rev-parse --show-toplevel" shows the current working directory if GIT_DIR is set.

What's different between what you expected and what actually happened?

Setting GIT_DIR to $(git rev-parse --git-dir) should not change anything.

Anything else you want to add:

Please review the rest of the bug report below.
You can delete any lines you don't wish to share.


[System Info]
git version:
git version 2.30.1
cpu: x86_64
no commit associated with this build
sizeof-long: 8
sizeof-size_t: 8
shell-path: /bin/sh
uname: Linux 5.3.18-22-default #1 SMP Wed Jun 3 12:16:43 UTC 2020 (720aeba) x86_64
compiler info: gnuc: 9.1
libc info: glibc: 2.26
$SHELL (typically, interactive shell): /opt/local/bin/bash


[Enabled Hooks]

             reply	other threads:[~2021-02-25 15:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-25 14:54 Martin Nicolay [this message]
2021-02-25 18:29 ` bug: setting GIT_DIR to $(git rev-parse --git-dir) changes behavior Junio C Hamano
  -- strict thread matches above, loose matches on Subject: below --
2021-02-26  7:54 Martin Nicolay
2021-02-27 21:06 ` Junio C Hamano
2021-03-01  8:08 Martin Nicolay

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=alpine.LSU.2.20.2102251549330.20742@cpza.bfz-tzou.qr \
    --to=m.nicolay@osm-ag.de \
    --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.
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).