git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 2/5] Fix setup of $GIT_DIR in git-sh-setup.sh

From
LHLars Hjemli <hjemli@gmail.com>
Date
Feb 18, 2008, 08:41 UTC
Message-ID
<8c5c35580802180041g5a193c31qeac1b9c920e41abf@mail.gmail.com>
In-Reply-To
<7v1w7au8d4.fsf@gitster.siamese.dyndns.org>
On Feb 18, 2008 6:44 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 9 quoted lines
> Lars Hjemli <hjemli@gmail.com> writes:
>
> > Since .git can be a file refering to the real GIT_DIR, git-sh-setup needs
> > to use 'git rev-parse --git-dir' to obtain the location of the git
> > repository.
>
> I wonder if this depend on your [1/5].  Isn't this actually a
> simplification (removing 7 adding 5 lines) that applies to the
> mainline already?
True. I'll resend as [1/5] with a fixed up commit message.
Show 13 quoted lines
> > @@ -127,20 +127,18 @@ get_author_ident_from_commit () {
> >  # if we require to be in a git repository.
> >  if test -z "$NONGIT_OK"
> >  then
> > +     GIT_DIR=$(git rev-parse --git-dir) || {
> > +             exit=$?
> > +             echo >&2 "Failed to find a valid git directory."
> > +             exit $exit
>
> rev-parse --git-dir would have said "fatal: Not a git
> repository" already.  Do we still need to say "Failed to
> find..."?
>
Absolutely not. Thanks.
-- 
larsh
Previous: Junio C HamanoNext: Johannes Schindelin
Message 8 of 17 in “Intoducing the .git file (again)”
  1. Lars HjemliFeb 17, 2008
  2. 1/5 Add platform-independent .git "symlink"Lars Hjemli, Feb 17, 2008
  3. 2/5 Fix setup of $GIT_DIR in git-sh-setup.shLars Hjemli, Feb 17, 2008
  4. 3/5 Teach resolve_gitlink_ref() about the .git fileLars Hjemli, Feb 17, 2008
  5. 4/5 git-submodule: prepare for the .git-fileLars Hjemli, Feb 17, 2008
  6. 5/5 Teach GIT-VERSION-GEN about the .git fileLars Hjemli, Feb 17, 2008
  7. Junio C HamanoFeb 18, 2008
  8. Lars HjemliFeb 18, 2008
  9. Johannes SchindelinFeb 17, 2008
  10. Lars HjemliFeb 17, 2008
  11. 1/5 Add platform-independent .git "symlink"Lars Hjemli, Feb 17, 2008
  12. Junio C HamanoFeb 18, 2008
  13. Lars HjemliFeb 18, 2008
  14. Johannes SchindelinFeb 18, 2008
  15. Johannes SchindelinFeb 17, 2008
  16. Lars HjemliFeb 17, 2008
  17. Johannes SchindelinFeb 17, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.