git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Heba Waly <heba.waly@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Heba Waly via GitGitGadget <gitgitgadget@gmail.com>,
	Git Mailing List <git@vger.kernel.org>
Subject: Re: [PATCH] git: update documentation for --git-dir
Date: Mon, 27 Jan 2020 15:22:01 +1300	[thread overview]
Message-ID: <CACg5j260t0Q1=5i_The5ARN0qRTDKiwmH-KYN5KqHye+Y_9gig@mail.gmail.com> (raw)
In-Reply-To: <xmqq1rrq65ed.fsf@gitster-ct.c.googlers.com>

On Thu, Jan 23, 2020 at 7:41 PM Junio C Hamano <gitster@pobox.com> wrote:
>
> "Heba Waly via GitGitGadget" <gitgitgadget@gmail.com> writes:
>
> It is not "not be able to figure out".  Specifying GIT_DIR (either
> with environment or the --git-dir option) tells Git that the $cwd is
> the top of the working tree unless otherwise specified (e.g. with
> GIT_WORK_TREE environment).  If you have to say something, saying
> "When GIT_DIR is specified, the usual repository discovery is
> skipped and the current directory is taken as the top level of the
> working tree unless otherwise speciffied" is probably OK.
>

Ok, I didn't understand it as intentional before, will update that.

> > +     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.
>

Fair enough.

> > +     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.

I agree, I couldn't find enough information on the matter to elaborate more.

> 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.

That helped me understand it better also, will use this, thanks.

>
> >  --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.

No I don't think I can change this one.

Thanks,
Heba

  reply	other threads:[~2020-01-27  2:22 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
2020-01-27  2:22   ` Heba Waly [this message]
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

  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='CACg5j260t0Q1=5i_The5ARN0qRTDKiwmH-KYN5KqHye+Y_9gig@mail.gmail.com' \
    --to=heba.waly@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=gitster@pobox.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.
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).