git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Yaroslav Nikitenko <metst13@gmail.com>
To: git@vger.kernel.org
Subject: git-dir requires work-tree; documentation improvements for working directory
Date: Sat, 2 Jan 2021 17:40:56 +0300	[thread overview]
Message-ID: <CA+RLzGCtp2T=8DG74geBs67X5vUvhwRP4FMZ6MJv+E+Pj=YbWw@mail.gmail.com> (raw)

Dear git users and maintainers,

I use git to manage my dotfiles with this command:

    git --git-dir=/home/yaroslav/.cfg/ --work-tree=/home/yaroslav

When reading documentation, I noticed two issues.

1) The command doesn't work without --work-tree (even from the top
level directory, which is my home directory).

    [~]$ git --git-dir=/home/yaroslav/.cfg/ status
    fatal: this operation must be run in a work tree

I don't have any configuration or environment variables for work-tree
(as warned here,
https://lore.kernel.org/git/CAPig+cRqkzPzNX8UN4OcgEOOKbtZRLCjNNiZsOVkGBy0pvsEkQ@mail.gmail.com/).

In `man git` for git-dir it says "If you are not at the top-level
directory of the working tree, you should tell Git where the top-level
of the working tree is" ("If"), the same is quoted in a recent thread
(https://lore.kernel.org/git/88D2A179-806F-4321-828A-359692E646B1@gmail.com/)

I'm using git version 2.30.0 on the most recent Arch Linux.

2) In the man documentation for git > git-dir it's written
"It can be an absolute path or relative path to current working directory."
I think this can be confused with work-tree. I suggest removing the
word 'working' (and probably add an article 'the' before the
'current', but I'm not a native speaker).

I can see that the expression "working directory" is used throughout
the man page of git, and it is used ambiguously (sometimes it means
the current directory, sometimes git working directory).

I don't subscribe to the mailing list but hope that I'll receive the replies.

Thank you and Happy New Year!

Best regards,
Yaroslav Nikitenko

             reply	other threads:[~2021-01-02 14:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-02 14:40 Yaroslav Nikitenko [this message]
2021-01-02 19:12 ` git-dir requires work-tree; documentation improvements for working directory Felipe Contreras
2021-01-02 19:44   ` Yaroslav Nikitenko
2021-01-02 22:02     ` Felipe Contreras
2021-01-03  9:12       ` Yaroslav Nikitenko
2021-01-03 11:57         ` Felipe Contreras
2021-01-04 23:47     ` Junio C Hamano

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='CA+RLzGCtp2T=8DG74geBs67X5vUvhwRP4FMZ6MJv+E+Pj=YbWw@mail.gmail.com' \
    --to=metst13@gmail.com \
    --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).