git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Felipe Contreras <felipe.contreras@gmail.com>
Cc: "Zbigniew Jędrzejewski-Szmek" <zbyszek@in.waw.pl>,
	git@vger.kernel.org, "Ted Pavlic" <ted@tedpavlic.com>,
	"Thomas Rast" <trast@student.ethz.ch>,
	"SZEDER Gábor" <szeder@ira.uka.de>,
	"Kerrick Staley" <mail@kerrickstaley.com>,
	"Marius Storm-Olsen" <mstormo@gmail.com>,
	"Ville Skyttä" <ville.skytta@iki.fi>,
	"Dan McGee" <dan@archlinux.org>
Subject: Re: [PATCH 2/2] completion: split __git_ps1 into a separate script
Date: Wed, 23 May 2012 09:30:36 -0700	[thread overview]
Message-ID: <7vk402272r.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <CAMP44s0aKi+8WHPXYLQ+iSMkj9iV88JGTabrpBRNBWb7upAMiQ@mail.gmail.com> (Felipe Contreras's message of "Wed, 23 May 2012 17:40:46 +0200")

Felipe Contreras <felipe.contreras@gmail.com> writes:

> And how do you propose to update the install documentation?
>
> #    1) Copy this file to somewhere (e.g. ~/.git-completion.sh).
> #    2) Add the following line to your .bashrc/.zshrc:
> #        source ~/.git-completion.sh
> #
> #    3) Consider changing your PS1 to also show the current branch:
>
> 1) Copy the file (e.g. ~/.git-completion.sh)
> 2) Copy the other file (.e.g ~/.git-prompt.sh)
> 3) Edit the original file (~/.git-completion.sh), modify the 'source'
> command to use the other file (~/.git-prompt.sh)
>
> And if the user doesn't care about prompt this certainly looks like overkill.

Agreed--the above would not fly.

> What do we gain by this incredible user annoyance? Less maintenance
> burden of __gitdir() which barely changes anyway?

If it lived in two separate projects, the pros-and-cons might be differnt
because there will be cost for coordinating changes between the projects,
but I do not think "barely changes" is a good rationale to keep duplicates
in this case, as we know both files come from the same project, and there
is no release engineering cost to coordiate changes.  The only price we
pay by not removing the duplicates at the source level is the risk of two
drifting apart without anybody noticing, and that particular risk becomes
the more likely the less often the function changes.  In other words,
"barely changes" is an argument _for_ removing duplicates.

Splitting the definition of whatever is duplicated out to a separate file,
having contrib/completion/Makefile insert it at an appropriate place in
both scripts at the build time, and driving that machinery from the
Makefile at the top-level would be one possible way forward.  For people
who download and install from the source, the "install insn" could also be
added to the generated file to avoid confusion (and for people who just
get the script(s) from their distro, the packagers would do that for
them).

You may think of a better solution to remove duplicates, of course, so I
am not married to the "have Makefile do it" approach and am open to
suggestions.

  reply	other threads:[~2012-05-23 16:30 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-22 20:46 [PATCH 0/2] completion: split into git-prompt.sh Felipe Contreras
2012-05-22 20:46 ` [PATCH 1/2] completion: remove executable mode Felipe Contreras
2012-05-22 20:46 ` [PATCH 2/2] completion: split __git_ps1 into a separate script Felipe Contreras
2012-05-22 21:07   ` Zbigniew Jędrzejewski-Szmek
2012-05-22 22:29     ` Ted Pavlic
2012-05-23 11:56       ` Felipe Contreras
2012-05-23 11:59     ` Felipe Contreras
2012-05-23 14:54     ` Junio C Hamano
2012-05-23 15:40       ` Felipe Contreras
2012-05-23 16:30         ` Junio C Hamano [this message]
2012-05-23 17:03         ` Ted Pavlic
2012-05-23 20:50           ` Felipe Contreras
2012-05-23 21:55             ` Ted Pavlic
2012-05-24 20:35               ` SZEDER Gábor
     [not found]                 ` <CAOnadRFbrhrFz7Ya3Vhgsju9G723Qu0OdJnM31xFmBqQNgj6gA@mail.gmail.com>
2012-05-25  7:35                   ` SZEDER Gábor
2012-05-25  7:50                     ` Thomas Rast
2012-05-25 10:01                       ` Felipe Contreras
2012-05-25 18:03                       ` Junio C Hamano
2012-05-24 20:49         ` SZEDER Gábor
2012-05-22 22:27   ` Ted Pavlic
2012-05-23 11:53     ` Felipe Contreras
2012-05-23 14:59       ` Junio C Hamano
2012-05-24 20:47   ` SZEDER Gábor
2012-05-25 17:51     ` Ville Skyttä
2012-10-25  0:51   ` Where should git-prompt.sh be installed? Jonathan Nieder
2012-10-25  1:59     ` Drew Northup
2012-10-25  6:02     ` Danny Yates
2012-10-25  7:45       ` [RFC/PATCH] __git_ps1: migrate out of contrib/completion Jonathan Nieder
2012-10-25 14:19         ` Felipe Contreras
2012-11-08 13:19         ` Todd Zullinger
2012-10-25  8:10       ` Where should git-prompt.sh be installed? Anders Kaseorg
2012-10-25 15:11     ` SZEDER Gábor
2012-10-25 16:12       ` Jonathan Nieder
2012-05-23 16:33 ` [PATCH 0/2] completion: split into git-prompt.sh 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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=7vk402272r.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=dan@archlinux.org \
    --cc=felipe.contreras@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=mail@kerrickstaley.com \
    --cc=mstormo@gmail.com \
    --cc=szeder@ira.uka.de \
    --cc=ted@tedpavlic.com \
    --cc=trast@student.ethz.ch \
    --cc=ville.skytta@iki.fi \
    --cc=zbyszek@in.waw.pl \
    /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.
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).