Recently, an acquaintance Andrei (recently switched to programming under Linux) wanted to create a new branch in git, but was not sure about the parameters and wanted to see a hint. He executed a command with logical, as it seemed to him, parameters:
git checkout -b --help
What do you think this team did? Correctly, created a branch with the name --help =)
Switched to a new branch '--help'
Well, no problem, remove it.
')
git checkout master
Switched to branch 'master'
git branch -d --help
But not everything is so simple. The result of the last command was the output of help on the git branch utility.
Hm Okay, let's try renaming a branch and then deleting it.
git branch -m --help todo_remove
And you guessed it, this command also printed a brief help on using the git branch.
Do you think right away how to remove it?
How to get rid of the branch and the unexpected continuation of the story under the cut.
Well, having rummaged in mana and having shown a little sharpness, an acquaintance solved the task:
git branch -d -- --help
Double hyphen stops checking options and all subsequent parameters are passed directly.
But the soul asked to send a bugreport, which he was going to do. As I mentioned, Andrey quite recently began to work actively with Linux and did not know about such things as sending projects. Therefore, he began to look for the “send an error message” button on git sites: git-scm.com, github.com, and so on. After a deeper search, he found how to report an error on bugs.launchpad.net, but they did not consider it a mistake, but promised to add a mention of this feature in the questions-answers.
Andrew did not calm down on this and decided to inform the developers directly. He found the author's git website. And I decided to write him a letter. You probably already guessed who it was =)
In the letter, Andrei complained that on the Microsoft website on the Microsoft Connect main page there is an error message button, and on websites dedicated to git-y - it does not exist;)
But the most amazing thing is that Linus responded to the letter! He confirmed that this is not a bug, but it is necessary to warn the user about it. I also advised my friend to use mailings or irc =)
Below is the answer to the letter:
Date: Fri, 4 Dec 2009 07:26:08 -0800 (PST)
From: Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: Git. Thank you. And bug.
To: *
On Fri, 4 Dec 2009, * wrote:
>
> Now about the bug. It's a funny one. Do you wonder what happens if you
> type 'git checkout -b --help'? It will create the new branch named
> --help =) I can’t do anything with it.
> branch -d --help & git checkout -m --help some_useful_name just do
> display help). It is funny.
Ok, not a bug,
of course
(they are hard to use too).
> A few thoughts about the community. I've been searching the place (hmmm
> ... to contribute or report a bug), I've spent about an hour and all
> I found a bug where it was found. I've been to
> git-scm.com, git-wiki, github, several searches in google, etc.) There
> was no button, no link 'report a bug' = (
The mailing list and maybe also add
the git maintainer to the cc. I may have started it but Junio ​​has been
for some years now
the git user.
So:
Git Mailing List <git@vger.kernel.org>
Junio ​​C Hamano <gitster@pobox.com>
> There is so much easier to find the information, I need, at
> Microsoft-related web resources. And that is very sad. How do you feel
> about it?
Heh. For git, I just did a google search for "git" and pressed "I'm
feeling lucky ", which took me to
git-scm.comsays it mailing list
#irc chat channel which can be very useful).
But yeah, if you don’t know what the mailing list is where everything
happens, maybe that doesn't make much of an impression;)
Linus