Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix "Branch name doesn't conform to GIT standards" error with transforma... #7

Closed
wants to merge 1 commit into from

Conversation

andyparkins
Copy link

...tion

A hg repository I successfully cloned using git-hg-remote gave the
following error on subsequent use of "git fetch" in the
.git/fast_import_crash_XXXX log:

fatal: Branch name doesn't conform to GIT standards: BRANCH.

I guessed that it might be the use of the "." in the branch name in hg
and applied this patch to my copy of git-hg-remote. That seemed to fix
the problem (and allowed a whole load of other tags into the clone that
had previously been skipped during the initial 'git clone hg::'
operation).

All this patch does is add to the transformations already present in
hgref() and gitref() to replace "." in hg refnames with "DOT" in the
git names. It's not ideal, but it allowed me to successfully complete
the "git fetch".

I'm not entirely convinced that the error from "git fast-import" is
valid, as I've used "." myself in tag names in pure git repos in the
past without difficulty in the past.

…rmation

A hg repository I successfully cloned using git-hg-remote gave the
following error on subsequent use of "git fetch" in the
.git/fast_import_crash_XXXX log:

    fatal: Branch name doesn't conform to GIT standards: BRANCH.

I guessed that it might be the use of the "." in the branch name in hg
and applied this patch to my copy of git-hg-remote.  That seemed to fix
the problem (and allowed a whole load of other tags into the clone that
had previously been skipped during the initial 'git clone hg::'
operation).

All this patch does is add to the transformations already present in
hgref() and gitref() to replace "." in hg refnames with "__DOT__" in the
git names.  It's not ideal, but it allowed me to successfully complete
the "git fetch".

I'm not entirely convinced that the error from "git fast-import" is
valid, as I've used "." myself in tag names in pure git repos in the
past without difficulty in the past.
@fingolfin
Copy link
Contributor

Git allows . inside of a refname, but not at the start or end. So "bran.ch" would work, but "branch." not.

@alexei-31
Copy link

A better solution to the issue offered by @Benabik in branch Benabik:master in commit 0669be9.

@felipec
Copy link
Owner

felipec commented May 17, 2016

The solution by @Benabik looks fine by me.

@felipec felipec added the bug label May 17, 2016
@jan-hudec
Copy link

jan-hudec commented Aug 22, 2017

I've just encountered this:

fatal: Branch name doesn't conform to GIT standards: refs/hg/upstream/tags/gmp-3_0___**FUNKY**

(in hg::https://gmplib.org/repo/gmp/)

Obviously, escaping leading and trailing periods is far from enough here. What about using URL-encoding for anything not permitted by GIT (because % is permitted)?

@EricCousineau-TRI
Copy link

I've made a PR with the above suggestion: #75

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants