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

Branch name with two or more _ character is sanitized #155

Closed
vo-va opened this issue May 9, 2019 · 4 comments
Closed

Branch name with two or more _ character is sanitized #155

vo-va opened this issue May 9, 2019 · 4 comments
Labels
user-support Help to users, can turn into a verfied bug if it turns out to be a problem with fast-export verified-bug A confirmed bug in fast-export

Comments

@vo-va
Copy link

vo-va commented May 9, 2019

Why two or more _ character in branch name are sanitized to one character?
git-check-ref-format(1) it does not forbid using two _ characters in a row.
Also I tried to use file to mapping branch name for example with this content

"_____v2"="_____v2"

It does not work for me.

@frej
Copy link
Owner

frej commented May 10, 2019 via email

@vo-va
Copy link
Author

vo-va commented May 10, 2019

Sorry, It is a private project.
You can reproduce this issue simply by creating new branch with two _ characters in row. For example

git checkout -b a__b

This branch will lead to warning.

Warning: sanitized branch [a__b] to [a_b]

These two lines cause my trouble https://github.com/frej/fast-export/blob/master/hg-fast-export.py#L231
So I know which lines I can patch to mitigate my trouble. But I don't understand why two or more _ forbidden.

@frej
Copy link
Owner

frej commented May 10, 2019

The only person knowing why two or more _ are forbidden is the original author. As we don't want to break existing conversions we can't just change the code.

The right way to handle this is along the lines of 7f42b8e in the user-support/fix-for-vo-va branch, try it out. It should make your remapping file work. Before pushing this to master I have to make sure the user is properly warned before getting the new behaviour.

@frej frej added user-support Help to users, can turn into a verfied bug if it turns out to be a problem with fast-export verified-bug A confirmed bug in fast-export labels May 10, 2019
@vo-va
Copy link
Author

vo-va commented May 14, 2019

Sorry for delay.
Yes this fix works for me - if branch mapping is specified two or more _ will not be removed.

@frej frej closed this as completed in 1181a0a Sep 13, 2019
frej added a commit that referenced this issue Sep 19, 2019
This tries to preemptively avoid recurrence of issues #148, #152,
 #155, #165 and #168.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
user-support Help to users, can turn into a verfied bug if it turns out to be a problem with fast-export verified-bug A confirmed bug in fast-export
Projects
None yet
Development

No branches or pull requests

3 participants
@frej @vo-va and others