Git development
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Cc: Jeff King <peff@peff.net>, Philip Oakley <philipoakley@iee.org>,
	Anders Kaseorg <andersk@mit.edu>,
	842477@bugs.debian.org, Git Mailing List <git@vger.kernel.org>,
	Vasco Almeida <vascomalmeida@sapo.pt>
Subject: Re: [PATCH] git-sh-setup: Restore sourcability from outside scripts
Date: Sun, 30 Oct 2016 15:53:55 -0700	[thread overview]
Message-ID: <xmqqh97tv470.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <CACBZZX6ArQdG202n-SouwDhoTE1LF=69mKjWQv8HPKJ+K_0fJQ@mail.gmail.com> ("Ævar Arnfjörð Bjarmason"'s message of "Sun, 30 Oct 2016 23:11:10 +0100")

Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:

(commenting out of order)

> It's probably worthwhile to split off git-sh-setup into git-sh-setup &
> git-sh-setup-internal along with a documentation fix. A lot of what
> it's doing (e.g. git_broken_path_fix(), and adding a die() function)
> is probably only needed internally by git itself. The
> git-sh-setup-internal should be the thing sourcing "git-sh-i18n", I
> don't see how anyone out-of-tree could make use of that. Surely nobody
> needs to re-emit the exact message we shipped with our *.po files.

My reading of d323c6b641 ("i18n: git-sh-setup.sh: mark strings for
translation", 2016-06-17) is abit different.  It needs to dot-source
the i18n stuff because the shell library functions it contains need
the localization support in the messages they emit.  IOW, I do not
think i18n belongs to -internal at all.

> I don't see why we shouldn't have some stable shellscript function API
> if that's needed either.
>
> I just wanted to point out that currently git-sh-setup isn't
> documented as such. So at least a follow-up patch to the documentation
> seems in order.
>
> This did break in v2.10.0, and it's taken a couple of months to notice
> this, so clearly it's not very widely used, which says something about
> the cost-benefit of maintaining this for external users.

I am not sure if "stable API" in sh-setup is a good thing for the
ecosystem in the longer term.

As more and more in-tree scripted Porcelain commands migrate to C,
many helper functions in sh-setup will lose their in-tree users.
For example, get_author_ident_from_commit used to have three in-tree
customers (git-commit.sh, git-am.sh and git-rebase--interactive.sh),
but the first two is long gone and the third one may soon lose its
need to call it.  Once a helper function in setup-sh loses all
in-tree users, we may no longer _break_ that helper, but that is
simply because we feel no need to touch it.  The in-tree Porcelain
commands that migrated to C however will enhance the counterpart
they use in C to be more featureful or fix longstanding bugs in the
C version they use, while sh-setup version bitrot and making old
practice obsolete for "modern" use of Git of the day.  

Keeping such a stale version that we do not use, or even we attempt
to update it without having a good vehicle to test the change
ourselves (because we no longer have any in-tree users) will be
disservice to third-party scripts---the only thing they are getting
by using the stale one, instead of reinventing their own that they
may be responsible to keep up to date, is that they share the same
staleness as everybody else that use the sh-setup version as a
third-party.

I am not arguing that we should remove what loses all in-tree users
immediately.  At least not yet.  But I wanted to point out that it
may not be a good use of our brain cycles to keep the API "stable"
by keeping what in-tree users do not use anymore, especially if it
does not help third-party users in the long run.



  reply	other threads:[~2016-10-30 22:54 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-30  2:10 [PATCH] git-sh-setup: Restore sourcability from outside scripts Anders Kaseorg
2016-10-30 17:55 ` Ævar Arnfjörð Bjarmason
2016-10-30 19:21   ` Anders Kaseorg
2016-10-30 20:09     ` Philip Oakley
2016-10-30 21:12       ` Jeff King
2016-10-30 22:11         ` Ævar Arnfjörð Bjarmason
2016-10-30 22:53           ` Junio C Hamano [this message]
2016-10-31  0:30           ` Anders Kaseorg
2016-10-30 22:25 ` 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=xmqqh97tv470.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=842477@bugs.debian.org \
    --cc=andersk@mit.edu \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    --cc=philipoakley@iee.org \
    --cc=vascomalmeida@sapo.pt \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox