Re: bad error message - Not a git repository (or any of the parent directories): .git

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Alexander,

On Thu, 3 Oct 2019, Alexander Mills wrote:

> when running git commands outside of a git repo, we often see:
>
> fatal: Not a git repository (or any of the parent directories): .git
>
> such a lame message lol.

An equally ornery response might point out that reporting this as a bug
instead of providing a patch is probably just as "lame"... :-)

> can we get an absolute path on this message in future git versions, eg:
>
> Not a git repository (or any of the parent directories): /home/ubuntu/xyz/.git

Just clone https://github.com/git/git, then look for that error message:

-- snip --
$ git grep -A1 "or any of the parent" \*.[ch]
setup.c:                        die(_("not a git repository (or any of the parent directories): %s"),
setup.c-                            DEFAULT_GIT_DIR_ENVIRONMENT);
-- snap --

You can then wrap the argument in that second line in `absolute_path()`,
build (using `make -j$(nproc)` on Linux), and test (use
`/path/to/git/bin-wrappers/git` instead of regular `git` to test without
installing). Once everything works as you expect it, commit it.

Please make sure that your commit message focuses on answering the
question "why?" more than on "how?", and that it wraps at <= 76 columns
per line. Also do make sure to add your sign off
(https://git-scm.com/docs/SubmittingPatches#sign-off).

Finally send the patch to the mailing list for review. You can use
GitGitGadget (https://gitgitgadget.github.io), submitGit
(https://submitgit.herokuapp.com) or send it manually
(https://github.com/git-for-windows/git/blob/master/CONTRIBUTING.md#submit-your-patch).

Ciao,
Johannes

> ty
>
> -alex
>
> --
> Alexander D. Mills
> New cell phone # (415)730-1805
> alexander.d.mills@xxxxxxxxx
>
> www.linkedin.com/pub/alexander-mills/b/7a5/418/
>




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux