worktree add: sanitize worktree names
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v5 Latest1 patch 9 repliesIn review
- v42 patches 2 repliesSuperseded
- v31 patch 7 repliesSuperseded
Earlier versions · 2
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v2 | 1 patch | 3 replies | Superseded | |
| v1 | 1 patch | 5 replies | Superseded |
Patches in v5 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/1 | worktree add: sanitize worktree namesbuiltin/ refs.c refs.h +1 more | +104 | 9 replies |
Reviews trailers per patch
The patch has no Reviewed-by or Acked-by.
| Patch | Jeff King |
|---|---|
| 1/1 | Helped-by |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v5 0/1] worktree add: sanitize worktree names
v5 is basically Jeff's version from one of the replies in v4, where check_refname_component is enhanced to optionally sanitize.
I was reluctant to go this way because it makes check_refname_component more complex (turns out still manageable) and burns worktree rules in it. But there may never be the second sanitization user, we deal with it when it comes.
As said, refs.c is pretty much Jeff's except two major changes:
- handle foo.lock.lock correctly by stripping .lock repeatedly
- sanitize refname _components_ instead of full refs. I could construct worktrees/<name> and pass to Jeff's sanitize_refname. But then I need to strip worktrees/ after that.
I took credits so that bugs come to me first (then I'll blame him anyway while doing some evil laughs)
Nguyễn Thái Ngọc Duy (1):
worktree add: sanitize worktree names
builtin/worktree.c | 10 +++- refs.c | 103 ++++++++++++++++++++++++++++++++-------- refs.h | 6 +++ t/t2400-worktree-add.sh | 5 ++ 4 files changed, 104 insertions(+), 20 deletions(-)
Signature · 1 line
2.21.0.rc1.337.gdf7f8d0522