git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Heba Waly via GitGitGadget" <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, Heba Waly <heba.waly@gmail.com>
Subject: Re: [PATCH] git: update documentation for --git-dir
Date: Wed, 22 Jan 2020 22:41:46 -0800	[thread overview]
Message-ID: <xmqq1rrq65ed.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <pull.537.git.1579745811615.gitgitgadget@gmail.com> (Heba Waly via GitGitGadget's message of "Thu, 23 Jan 2020 02:16:51 +0000")

"Heba Waly via GitGitGadget" <gitgitgadget@gmail.com> writes:

>  --git-dir=<path>::
> -	Set the path to the repository. This can also be controlled by
> -	setting the `GIT_DIR` environment variable. It can be an absolute
> -	path or relative path to current working directory.
> -
> +	Set the path to the repository (i.e. the .git folder). This can also be

I suspect (i.e. ".git") may be clear enough, but if you must, say
".git directory", not ".git folder", as you mention "current working
directory" later.

> +	controlled by setting the `GIT_DIR` environment variable. It can be
> +	an absolute path or relative path to current working directory.
> +
> +	Note that --git-dir=<path> is not the same as -C=<path>.

Surely, of course.

> +	It's preferrable to set --work-tree=<path> as well when setting
> +	--git-dir to make sure Git will run your command across the correct
> +	work tree.

It does not help the readers that much to say "It's preferrable"
without saying what negative implications there are if they don't
use it, or what positive effect they would observe if they do.

If I were writing it, I'd drop "Note that..." and rewrite the three
lines more like...

	Specifying the location of the ".git" directory using this
	option (or GIT_DIR environment variable) turns off the
	repository discovery that tries to find a directory with
	".git" subdirectory (which is how the repository and the
	top-level of the working tree are discovered), and tells Git
	that you are at the top level of the working tree.  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,
	with the --work-tree=<path> option (or GIT_WORK_TREE
	environment variable)

perhaps.

>  --work-tree=<path>::
>  	Set the path to the working tree. It can be an absolute path
>  	or a path relative to the current working directory.
>
> base-commit: 232378479ee6c66206d47a9be175e3a39682aea6

I do not know if GGG users have control over this, but I'd prefer to
see a "-- " divider before this "base-commit: ..." footer material.

  parent reply	other threads:[~2020-01-23  6:41 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-23  2:16 [PATCH] git: update documentation for --git-dir Heba Waly via GitGitGadget
2020-01-23  2:35 ` Heba Waly
2020-01-23  2:55 ` Emily Shaffer
2020-01-23  6:44   ` Junio C Hamano
2020-01-23  6:21 ` Junio C Hamano
2020-01-23  6:41 ` Junio C Hamano [this message]
2020-01-27  2:22   ` Heba Waly
2020-01-27  2:24 ` [PATCH v2] " Heba Waly via GitGitGadget
2020-01-27  6:28   ` Johannes Sixt
2020-01-28  4:17     ` Heba Waly
2020-01-28  7:33       ` Jeff King
2020-01-28 10:40         ` Heba Waly
2020-01-28  4:24   ` [PATCH v3] " Heba Waly via GitGitGadget
2020-01-28 19:22     ` Junio C Hamano
2020-01-29 12:10       ` Heba Waly
2020-01-30  1:14     ` [PATCH v4] " Heba Waly via GitGitGadget
2020-01-30 18:26       ` 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

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

  git send-email \
    --in-reply-to=xmqq1rrq65ed.fsf@gitster-ct.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=heba.waly@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.
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).