All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Eric Sunshine <sunshine@sunshineco.com>
Cc: Git List <git@vger.kernel.org>,
	Johannes Schindelin <Johannes.Schindelin@gmx.de>,
	Hariom verma <hariom18599@gmail.com>
Subject: Re: [PATCH] worktree: avoid dead-code in conditional
Date: Wed, 24 Jun 2020 17:38:18 -0700	[thread overview]
Message-ID: <xmqqbll8569x.fsf@gitster.c.googlers.com> (raw)
In-Reply-To: <CAPig+cRdRyWAjU7QADPt39rDgJ4njDtN_pwo8JMVD=YX09a-Vg@mail.gmail.com> (Eric Sunshine's message of "Wed, 24 Jun 2020 19:00:37 -0400")

Eric Sunshine <sunshine@sunshineco.com> writes:

> Callers of get_git_common_dir() aren't forced to care. But after
> applying strbuf_add_absolute_path() we are forced to care. This is the
> result of get_git_common_dir() for the three cases:
>
>     .     (within bare repo)
>     .git  (within any worktree)
>     .     (within .git)
>
> After applying strbuf_add_absolute_path(), we get:
>
>     /whatever/proj.git/.   (within bare proj)
>     /whatever/proj/.git    (within any worktree)
>     /whatever/proj/.git/.  (within .git)

OK, but the point still stands.  

Shouldn't strbuf_add_absolute_path() be what we want to normalize?

> Your puzzlement may arise from the misunderstanding regarding
> get_git_common_dir() vs. strbuf_add_absolute_path()?

Yes, exactly.

Thanks.

      reply	other threads:[~2020-06-25  0:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-24 19:05 [PATCH] worktree: avoid dead-code in conditional Eric Sunshine
2020-06-24 21:20 ` Junio C Hamano
2020-06-24 23:00   ` Eric Sunshine
2020-06-25  0:38     ` Junio C Hamano [this message]

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=xmqqbll8569x.fsf@gitster.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=hariom18599@gmail.com \
    --cc=sunshine@sunshineco.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.