git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Theodore Ts'o" <tytso@mit.edu>
To: Crls <kaploceh@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: ctrl-z ignored by git; creates blobs from non-existent repos
Date: Sun, 15 Jan 2023 10:45:19 -0500	[thread overview]
Message-ID: <Y8Qfj32h89hq5UD6@mit.edu> (raw)
In-Reply-To: <632d051b-d81b-b35d-0641-c2488a124810@gmail.com>

On Fri, Jan 13, 2023 at 05:01:01PM -0500, Crls wrote:
> Ctrl-Z is ignored by git; Git-clone injects blobs even with non-existent
> repos
> 
> Steps to reproduce 1- git clone github whateverrepo/whatevernonexistentrepo
> or 1- git clone gitlab whateverrepo/whatevernonexistentrepo 2= Git prompts
> for a username

% git clone github whateverrepo/whatevernonexistentrepo
fatal: repository 'github' does not exist

I think what you meant was:

% git clone https://github.com/whateverrepo/whatevernonexistentrepo
Cloning into 'whatevernonexistentrepo'...
Username for 'https://github.com': 

> 3- Press Ctrl-Z to stop *git* from running either on the virtual console/tty
> *git* automatically creates blobs with directories and disregards

So it's not that Control-Z is being ignored.  It's that by the time
you see the prompt for "Username for 'https://github.com': ", the
directories already exist.  Try looking at
whatevernonexistentrepo/.git as soon as the prompt shows up.  You'll
see that the .git directory has been greated.

Now, when you type ^Z, the git processes are stopped --- but the
objects are created already.

Username for 'https://github.com': ^Z
[1]+  Stopped                 git clone https://github.com/whateverrepo/whatevernonexistentrepo
% ps aux | grep git
tytso       5097  0.0  0.0   9736  4480 pts/0    T    10:41   0:00 git clone https://github.com/wha
tytso       5098  0.0  0.0   9736  3992 pts/0    T    10:41   0:00 /usr/lib/git-core/git remote-htt
tytso       5099  0.0  0.1 102332 16104 pts/0    T    10:41   0:00 /usr/lib/git-core/git-remote-htt
tytso       5140  0.0  0.0   6332  2072 pts/0    S+   10:43   0:00 grep git


The 'T' means that the processes are stopped.

> Expected: The same issue does not happen with other non-existent repos e.g.,
> git clone git.zx2c4/ it returns the message of fatal repo not found

So what's going on is that github.com is not returning a non-existent
repo error; it's prompting for a username/password, as _if_ the
repository exists.  That's presumably to prevent disclosing
information as to whether or not a private repository exists or not.

Once the authentication fails, git will remove the partially created
repro, so it's really not a problem in practice.

Cheers,

						- Ted

  reply	other threads:[~2023-01-15 15:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-13 22:01 ctrl-z ignored by git; creates blobs from non-existent repos Crls
2023-01-15 15:45 ` Theodore Ts'o [this message]
2023-01-15 18:36   ` Jeff King
2023-01-15 22:47   ` Crls
2023-01-15 23:33     ` Jeff King
2023-01-17 22:40       ` Crls
2023-01-16  2:07     ` 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=Y8Qfj32h89hq5UD6@mit.edu \
    --to=tytso@mit.edu \
    --cc=git@vger.kernel.org \
    --cc=kaploceh@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).