All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: git@vger.kernel.org, "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
Subject: Re: [PATCH] rev-parse --git-path: fix output when running in a subdirectory
Date: Thu, 09 Feb 2017 13:50:31 -0800	[thread overview]
Message-ID: <xmqqo9ybnie0.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <alpine.DEB.2.20.1702092201080.3496@virtualbox> (Johannes Schindelin's message of "Thu, 9 Feb 2017 22:05:24 +0100 (CET)")

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

> On Wed, 8 Feb 2017, Junio C Hamano wrote:
>
>> How long has "rev-parse --git-path" been around?  Had scripts in the
>> wild chance to learn to live with the "output is relative to the top of
>> the working tree" reality?  I think the answers are "since 2.5" and
>> "yes".
>
> Correct. And the third question is: How did the scripts work around this
> feature?
>
> The answer is obvious: by switching back to `$(git rev-parse
> --git-dir)/filename`.
>
> This is literally on what I spent the better part of Wednesday.
>
> There is just no way you can "fix" this otherwise. As an occasional shell
> scripter, you may be tempted to use `$(git rev-parse --show-cdup)$(git
> rev-parse --git-path filename)`, but of course that breaks in worktrees
> and if you do not use worktrees you would not even know that your
> workaround introduced another bug.

In case it is not clear, I understand all of the above.  

I was just worried about the people who do *NOT* use worktrees and
did the obvious "concatenate --cdup with --git-path" and thought
their script were working happily and well.  By prepending the path
to the (real) location of the .git in the updated --git-path output
ourselves, they will complain, our update broke their script.

If we introduced the fix gently, by (1) warn when "--git-path" is
used but give the current output anyway, while adding the "fixed"
one as another new option, and then (2) remove "--git-path" after
several releases, they will not have to complain, even though they
will see warning until they stop using "--git-path".

There may be gentler alternative ways to transition, and I do not
worry about the specifics of them too much.  I just think we cannot
do this in a single step without harming existing users.



  reply	other threads:[~2017-02-09 21:51 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-08 12:17 [PATCH] rev-parse --git-path: fix output when running in a subdirectory Johannes Schindelin
2017-02-08 18:47 ` Junio C Hamano
2017-02-09 21:05   ` Johannes Schindelin
2017-02-09 21:50     ` Junio C Hamano [this message]
2017-02-10  4:21       ` Jeff King
2017-02-09  9:48 ` Duy Nguyen
2017-02-09 13:46   ` Mike Rappazzo
2017-02-09 21:11     ` Johannes Schindelin
2017-02-09 21:33   ` Junio C Hamano
2017-02-09 22:11     ` Johannes Schindelin
2017-02-09 22:54       ` Junio C Hamano
2017-02-10  3:52         ` Mike Rappazzo
2017-02-10 15:44           ` Johannes Schindelin
2017-02-10 15:33 ` [PATCH v2 0/2] Fix bugs in rev-parse's output when run " Johannes Schindelin
2017-02-10 15:33   ` [PATCH v2 1/2] rev-parse tests: add tests executed from " Johannes Schindelin
2017-02-10 18:50     ` Junio C Hamano
2017-02-17 16:55       ` Johannes Schindelin
2017-02-10 20:25     ` Junio C Hamano
2017-02-17 16:57       ` Johannes Schindelin
2017-02-10 15:33   ` [PATCH v2 2/2] rev-parse: fix several options when running in " Johannes Schindelin
2017-02-10 18:57     ` Junio C Hamano
2017-02-17 16:53       ` Johannes Schindelin
2017-02-10 18:59   ` [PATCH v2 0/2] Fix bugs in rev-parse's output when run " Junio C Hamano
2017-02-17 16:58   ` [PATCH v3 " Johannes Schindelin
2017-02-17 16:59     ` [PATCH v3 1/2] rev-parse tests: add tests executed from " Johannes Schindelin
2017-02-17 16:59     ` [PATCH v3 2/2] rev-parse: fix several options when running in " Johannes Schindelin
2017-02-17 18:25     ` [PATCH v3 0/2] Fix bugs in rev-parse's output when run " 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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqo9ybnie0.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=pclouds@gmail.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.