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