threads / discuss / 61226

Git Gui Clone: Error Failed to create repository (with hints)

Subject: Git Gui Clone: Error Failed to create repository (with hints)

## tl;dr

2 messages between Mar 29, 2024 and Apr 3, 2024.

replies: 1people: 2as markdown or json

Tobias Boesch· Mar 29, 2024, 21:12 UTC · lore
Hello everyone,

when I clone a git repo (from github or COdeberg) through Git Gui I get the following GUI error (nothing in the terminal and nothing in journalctl):

"Failed to create repository <repo-path>: Hint Using 'master' as the name for the initial branch. This default branch..." and so on.

Screenshot https://i.postimg.cc/66df98MZ/Screenshot-from-2024-03-29-22-06-49.png

I have no idea what is going on here. Has someone an idea what the reason could be?

Cloning the same source into the same path from command line works. The cloned git repo opens fine in git gui.

Best wishes Tobias

Jeff King· Apr 3, 2024, 01:30 UTC · re: Tobias Boesch · lore

Re: Git Gui Clone: Error Failed to create repository (with hints)

On Fri, Mar 29, 2024 at 10:12:17PM +0100, Tobias Boesch wrote:
Show 12 quoted lines
> when I clone a git repo (from github or COdeberg) through Git Gui I get
> the following GUI error (nothing in the terminal and nothing in
> journalctl):
> 
> "Failed to create repository <repo-path>: Hint Using 'master' as the
> name for the initial branch. This default branch..." and so on.
> 
> Screenshot
> https://i.postimg.cc/66df98MZ/Screenshot-from-2024-03-29-22-06-49.png
> 
> I have no idea what is going on here. Has someone an idea what the
> reason could be?

I don't work on or use git-gui, but it is written in Tcl/Tk. And IIRC Tcl is very anxious to consider programs that print anything to stderr as "failed". And in this case we are just printing warning/hint diagnostics to stderr.

I suspect there are solutions within git-gui's code base to check the actual exit code, and it's just a bug that we're not using them in this instance. But the obvious workaround in the meantime is to set the config that the hint mentions, which should silence it.

> Cloning the same source into the same path from command line works.
> The cloned git repo opens fine in git gui.

Right, the clone is happening fine. It's just that git-gui is incorrectly thinking that it failed.

-Peff

← back to recent threads