git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* bad error message - Not a git repository (or any of the parent directories): .git
@ 2019-10-03 22:37 Alexander Mills
  2019-10-04  9:33 ` Johannes Schindelin
  0 siblings, 1 reply; 2+ messages in thread
From: Alexander Mills @ 2019-10-03 22:37 UTC (permalink / raw)
  To: git

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

ty

-alex

-- 
Alexander D. Mills
New cell phone # (415)730-1805
alexander.d.mills@gmail.com

www.linkedin.com/pub/alexander-mills/b/7a5/418/

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: bad error message - Not a git repository (or any of the parent directories): .git
  2019-10-03 22:37 bad error message - Not a git repository (or any of the parent directories): .git Alexander Mills
@ 2019-10-04  9:33 ` Johannes Schindelin
  0 siblings, 0 replies; 2+ messages in thread
From: Johannes Schindelin @ 2019-10-04  9:33 UTC (permalink / raw)
  To: Alexander Mills; +Cc: git

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@gmail.com
>
> www.linkedin.com/pub/alexander-mills/b/7a5/418/
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-10-04  9:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-03 22:37 bad error message - Not a git repository (or any of the parent directories): .git Alexander Mills
2019-10-04  9:33 ` Johannes Schindelin

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