git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Roman Neuhauser <rn+git@sigpipe.cz>
To: Junio C Hamano <gitster@pobox.com>
Cc: "Øystein Walle" <oystwa@gmail.com>, git@vger.kernel.org
Subject: Re: [PATCH v2] clone: Allow combining --bare and --origin
Date: Fri, 6 Aug 2021 22:23:58 +0200	[thread overview]
Message-ID: <YQ2aXpfzyOOUFhQk@isis.sigpipe.cz> (raw)
In-Reply-To: <xmqqbl6dqgvc.fsf@gitster.g>

Hello,

i'm "the user" in this story.  Muchas gracias to osse for turning
my bickering into a patch.

A little background.  I use --origin a lot (or git remmote rename
afterwards), because origin carries no information about the remote
repository, and I could have cloned any of those.  The URL I used
in `git clone` has little to do with which remotes I'll want to
pull from and which I'll want to push to.  "origin" is suspicious
and I'm used to giving my remotes names that mean something to me.

My need for git clone --bare --origin surfaced when I was writing
a tool for versioning dotfiles (don't we all have one).  It has to
be able to work with pre-existing files in the home dir:

$ git dirs clone $url x
# git-dir is $PWD/.git-dirs/repo.d/x
# work-tree is $PWD

I used git clone --bare / git config core.bare false /
git config core.worktree ... and hit the error message when I tried
to add support for --origin.

# gitster@pobox.com / 2021-08-04 10:06:31 -0700:
> In other words, if there were two remotes in the configuration file,
> you cannot tell which one was given to --origin when you made the
> repository with "git clone".

I'm not sure why this matters (not saying it doesn't).
 
> But we'd end up treating them the same.  And something like
> remote.originName would help that.  Otherwise, we'd end up sending
> this message:
> 
>     Even if we give "--bare --origin yourfavouritename" to you now,
>     unlike how 'origin' is treated in the default case, in the
>     resulting repository, 'yourfavouritename' is not special at all.

Isn't that the case in non-bare repositories as well?
BTW I don't like special cases but realize that the "origin" ship has
sailed long ago.
 
> Some people may want to treat yourfavouritename is not special at
> all, while some people may want to treat yourfavouritename truly as
> a replacement for 'origin' that is the default.  The message we
> would be sending is that we'd ignore the latter folks.
 
Can't they just continue doing what they've been doing so far,
that is leave it at "origin"?  I'm not sure this would be my concern
as a user of this feature.

-- 
roman

  reply	other threads:[~2021-08-06 20:32 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-01  8:25 [PATCH] clone: Remove constraint on --bare and --origin Øystein Walle
2021-08-02  2:18 ` Junio C Hamano
2021-08-02  8:53 ` Ævar Arnfjörð Bjarmason
2021-08-02 17:49   ` [PATCH v2] clone: Allow combining " Øystein Walle
2021-08-03 21:28     ` Junio C Hamano
2021-08-04 13:30       ` Øystein Walle
2021-08-04 17:06         ` Junio C Hamano
2021-08-06 20:23           ` Roman Neuhauser [this message]
2021-08-06 22:13             ` Junio C Hamano
2021-08-07 11:18               ` Roman Neuhauser
2021-08-07 22:08           ` Re* " Junio C Hamano
2021-08-08  2:03             ` Roman Neuhauser
2021-08-04  1:16     ` 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=YQ2aXpfzyOOUFhQk@isis.sigpipe.cz \
    --to=rn+git@sigpipe.cz \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=oystwa@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.
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).