-
Notifications
You must be signed in to change notification settings - Fork 141
Make git rebase -r
's label generation more resilient
#327
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
Conversation
/submit |
Submitted as [email protected] |
(See also git-for-windows#2315) |
One of the trickier aspects of the design of `git rebase --rebase-merges` is the way labels are generated for the initial todo list: those labels are supposed to be intuitive and first and foremost unique. To that end, `label_oid()` appends a unique suffix when necessary. Those labels not only need to be unique, but they also need to be valid refs. To make sure of that, `make_script_with_merges()` replaces whitespace by dashes. That would appear to be the wrong layer for that sanitizing step, though: all callers of `label_oid()` should get that same benefit. Even if it does not make a difference currently (the only called of `label_oid()` that passes a label that might need to be sanitized _is_ `make_script_with_merges()`), let's move the responsibility for sanitizing labels into the `label_oid()` function. This commit is best viewed with `-w` because it unfortunately needs to change the indentation of a large block of code in `label_oid()`. Signed-off-by: Johannes Schindelin <[email protected]>
The `label` todo command in interactive rebases creates temporary refs in the `refs/rewritten/` namespace. These refs are stored as loose refs, i.e. as files in `.git/refs/rewritten/`, therefore they have to conform with file name limitations on the current filesystem in addition to the accepted ref format. This poses a problem in particular on NTFS/FAT, where e.g. the colon, double-quote and pipe characters are disallowed as part of a file name. Let's safeguard against this by replacing not only white-space characters by dashes, but all non-alpha-numeric ones. However, we exempt non-ASCII UTF-8 characters from that, as it should be quite possible to reflect branch names such as `↯↯↯` in refs/file names. Signed-off-by: Matthew Rogers <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]>
4a02c38
to
adc22c8
Compare
/submit |
Submitted as [email protected] |
On the Git mailing list, Junio C Hamano wrote (reply to this):
|
This branch is now known as |
This patch series was integrated into pu via git@9ac4901. |
On the Git mailing list, Danh Doan wrote (reply to this):
|
On the Git mailing list, Doan Tran Cong Danh wrote (reply to this):
|
On the Git mailing list, Johannes Schindelin wrote (reply to this):
|
On the Git mailing list, Johannes Schindelin wrote (reply to this):
|
This patch series was integrated into pu via git@da8e83b. |
This patch series was integrated into pu via git@eff2a14. |
This patch series was integrated into pu via git@3ff83f1. |
This patch series was integrated into pu via git@bb7e150. |
On the Git mailing list, Junio C Hamano wrote (reply to this):
|
This patch series was integrated into pu via git@107077a. |
This patch series was integrated into pu via git@94b3cc1. |
This patch series was integrated into next via git@791d51b. |
This patch series was integrated into pu via git@089c065. |
This patch series was integrated into pu via git@81c0274. |
This patch series was integrated into pu via git@cee86dc. |
This patch series was integrated into pu via git@8c396f1. |
This patch series was integrated into pu via git@f65c70b. |
This patch series was integrated into pu via git@917d0d6. |
This patch series was integrated into next via git@917d0d6. |
This patch series was integrated into master via git@917d0d6. |
Closed via 917d0d6. |
Those labels must be valid ref names, and therefore valid file names. The initial patch came in via Git for Windows.
Change since v1:
label_oid()
, as a preparatory step.Cc: Doan Tran Cong Danh [email protected]