git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 00/11] Start retiring .git/remotes/ and .git/branches/ for good
Date: Mon, 15 May 2017 10:42:25 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.21.1.1705151022160.146734@virtualbox> (raw)
In-Reply-To: <xmqq7f1l6as6.fsf@gitster.mtv.corp.google.com>

Hi Junio,

On Sat, 13 May 2017, Junio C Hamano wrote:

> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> 
> > On Fri, 12 May 2017, Junio C Hamano wrote:
> >>  ...
> >> FWIW, I do not think there is any reason for people to be using
> >> .git/remotes/, but for .git/branches/, I do not think I can offer a
> >> more efficient and easier to use alternative based on .git/config to
> >> do these things:
> >> 
> >>  $ grep <substring> .git/branches/* ;# what did I call that remote?
> >>  $ cat .git/branches/$name ;# where do I get that from?
> >>  $ echo "$URL#$branch" >.git/branches/$name ;# I just learned a new src
> >>  $ rm .git/branch/$name ;# I no longer need it
> >> 
> >> without having to learn things experienced CLI/UNIX person already
> >> knows.
> >
> > I do not understand what you want to tell me with that example. It is
> > confusing me utterly.
> 
> They show how it helps a user, whose primary use of Git is to fetch
> from many places, to keep the the old "branches" machinery.

M'kay. Not quite sure how that differs from my use case, which works quite
well with the "config" way. My `git remote | wc -l` says 21.

Let me re-format what you said next.

> It is not "hard" to migrate in the sense that there is a way to
>
> (1) find the short-name you gave to a remote from a part of URL etc.,
>
> (2) find the exact attributes of the repository a short-name refers to,
>
> (3) update an existing or add a new short-name and
>
> (4) remove an existing one.
>
> The remotes.*.{url,fetch} configuration are expressive enough to
> represent these operations.  It however is more work and I couldn't
> think of alternatives.

So if I understand correctly, you want to do

(1) `git remote -v | grep <part-of-the-url>`

(2) `git remote show <shortname>`

(3) if (1) did not find it:
	`git remote add -f <short-name> <URL>`,
    otherwise:
	`git fetch <shortname>`

(4) `git remove rm <shortname>`

I have to admit that I used `git remote -v | grep ^<shortname>` for (2)
all the time, until I had a quick look at builtin/remote.c so I would not
make a complete fool out of myself in this reply, and I will use `git -p
remote show <shortname>` henceforth.

As to (1), I really do not use this myself, as my remotes pretty much
always have names that I remember very well. And if I don't, neither do I
remember the URL, so I have to sift through the output of `git -p remote
-v` manually anyway.

> >> We simply cannot beat the above with anything like 
> >> 
> >>     $ git config remote.$name.fetch refs/heads/$branch
> >> 
> >> even though the config based remote definition may be infinitely
> >> more powerful.
> >
> > Then maybe we need to teach, say, `git remote` to be that powerful?
> 
> Ah, after all, you weren't confused utterly.

No, I was, and I am still at least partially confused. I just read your
"We simply cannot beat ..." as a round-about way to say "I wish we had an
easy way to do XYZ" without stating the XYZ in a way that even dimwits
such as myself can understand.

> Not necessarily "that powerful", but yes, if we had something that
> is quick and easy to use as a replacement, I do agree we can plan
> .git/{branches,remotes}'s removal.  The point of "branches" thing to
> existing users, I think, is not its expressive power (it is much
> much simpler and can do only one thing) but its simplicity.

Okay, so my quest at removing maintenance burden is not entirely pointless
an exercise and a waste of my time.

Good. I will continue to work on that front, then, among other things.

Ciao,
Dscho

  reply	other threads:[~2017-05-15  8:42 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-11 13:47 Johannes Schindelin
2017-05-11 13:47 ` [PATCH 01/11] git-parse-remote: fix highly misleading man page Johannes Schindelin
2017-05-11 17:21   ` Stefan Beller
2017-05-11 19:14     ` Johannes Schindelin
2020-11-11 15:17     ` [PATCH 0/5] Remove now-unused git-parse-remote Ævar Arnfjörð Bjarmason
2020-11-11 17:37       ` Jeff King
2020-11-11 19:29         ` Junio C Hamano
2020-11-12 14:09         ` Ævar Arnfjörð Bjarmason
2020-11-12 18:42           ` Jeff King
2020-11-12 14:19       ` How do I "git fetch" with a custom <refspec> but a default remote? Ævar Arnfjörð Bjarmason
2020-11-12 18:51         ` Jeff King
2020-11-12 19:26           ` Chris Torek
2020-11-12 20:48             ` Jeff King
2020-11-12 21:22               ` Junio C Hamano
2020-11-14 12:12         ` Ævar Arnfjörð Bjarmason
2020-11-11 15:17     ` [PATCH 1/5] parse-remote: remove unused GIT_DIR variable Ævar Arnfjörð Bjarmason
2020-11-11 15:17     ` [PATCH 2/5] parse-remote: remove long-dead rebase code Ævar Arnfjörð Bjarmason
2020-11-11 15:17     ` [PATCH 3/5] parse-remote: remove long-dead git-pull.sh code Ævar Arnfjörð Bjarmason
2020-11-11 15:17     ` [PATCH 4/5] parse-remote: move used code to git-submodule.sh Ævar Arnfjörð Bjarmason
2020-11-11 15:17     ` [PATCH 5/5] parse-remote: remove this now-unused library Ævar Arnfjörð Bjarmason
2020-11-11 16:33       ` Junio C Hamano
2020-11-12 20:31         ` [PATCH v2 0/2] Retire git-parse-remote Junio C Hamano
2020-11-12 20:31           ` [PATCH v2 1/2] parse-remote: move used code to git-submodule.sh Junio C Hamano
2020-11-12 20:31           ` [PATCH v2 2/2] parse-remote: remove this now-unused library Junio C Hamano
2020-11-12 20:49           ` [PATCH v2 0/2] Retire git-parse-remote Jeff King
2020-11-12 21:25             ` Junio C Hamano
2020-11-13  9:42           ` Ævar Arnfjörð Bjarmason
2020-11-14 12:21           ` [PATCH v3 0/3] submodule sh->C & retire parse-remote Ævar Arnfjörð Bjarmason
2020-11-14 12:21           ` [PATCH v3 1/3] submodule: use "fetch" logic instead of custom remote discovery Ævar Arnfjörð Bjarmason
2020-11-16 21:13             ` Junio C Hamano
2020-11-14 12:21           ` [PATCH v3 2/3] submodule: remove sh function in favor of helper Ævar Arnfjörð Bjarmason
2020-11-14 12:21           ` [PATCH v3 3/3] parse-remote: remove this now-unused library Ævar Arnfjörð Bjarmason
2020-11-16 21:19             ` Junio C Hamano
2020-11-17 14:24               ` Ævar Arnfjörð Bjarmason
2017-05-11 13:47 ` [PATCH 02/11] Documentation: really deprecate .git/remotes/ and .git/branches/ Johannes Schindelin
2017-05-11 13:47 ` [PATCH 03/11] remote: warn loud and clear when .git/branches/ is *still* used Johannes Schindelin
2017-05-11 13:47 ` [PATCH 04/11] remote: warn loud and clear when .git/remotes/ " Johannes Schindelin
2017-05-11 13:47 ` [PATCH 05/11] Revert "Revert "Don't create the $GIT_DIR/branches directory on init"" Johannes Schindelin
2017-05-11 17:26   ` Stefan Beller
2017-05-11 13:47 ` [PATCH 06/11] PREVIEW: t5510: convert .git/remotes/ test to use a regular remote Johannes Schindelin
2017-05-11 13:47 ` [PATCH 07/11] PREVIEW: t5516: stop testing .git/branches/ functionality Johannes Schindelin
2017-05-11 13:47 ` [PATCH 08/11] PREVIEW: remote: remove support for migrating ancient remotes Johannes Schindelin
2017-05-11 13:48 ` [PATCH 09/11] PREVIEW: t5515: remove .git/remotes/ and .git/branches/ tests Johannes Schindelin
2017-05-11 13:48 ` [PATCH 10/11] PREVIEW: t0060: stop testing support for .git/remotes/ and .git/branches/ Johannes Schindelin
2017-05-11 13:48 ` [PATCH 11/11] PREVIEW: remove " Johannes Schindelin
2017-05-11 18:19   ` Stefan Beller
2017-05-11 19:19     ` Johannes Schindelin
2017-05-12  1:14 ` [PATCH 00/11] Start retiring .git/remotes/ and .git/branches/ for good Junio C Hamano
2017-05-12 10:18   ` Johannes Schindelin
2017-05-16  0:37     ` Junio C Hamano
2017-05-16  8:05       ` Ævar Arnfjörð Bjarmason
2017-05-16  9:06         ` Junio C Hamano
2017-05-16 10:02           ` Ævar Arnfjörð Bjarmason
2017-05-17  0:51             ` Junio C Hamano
2017-05-12 12:00   ` Junio C Hamano
2017-05-12 14:19     ` Johannes Schindelin
2017-05-12 17:38       ` Jonathan Nieder
2017-05-13 10:13         ` Junio C Hamano
2017-05-12 21:11       ` Junio C Hamano
2017-05-15  8:42         ` Johannes Schindelin [this message]
2017-05-12  9:11 ` Jeff King
2017-05-12 11:09   ` Johannes Schindelin

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=alpine.DEB.2.21.1.1705151022160.146734@virtualbox \
    --to=johannes.schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --subject='Re: [PATCH 00/11] Start retiring .git/remotes/ and .git/branches/ for good' \
    /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

Code repositories for project(s) associated with this 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).