nd/worktree-cleanup-post-head-protection update
Get series with b4
b4 am [email protected]Versions newest first
- v2 Latest6 patches 4 repliesIn review
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/6 | completion: support git-worktreecontrib/ | +23 | 0 replies | |
| 2/6 | worktree.c: rewrite mark_current_worktree() to avoid strbufworktree.c | +7 | 0 replies | |
| 3/6 | git-worktree.txt: keep subcommand listing in alphabetical orderDocumentation/ builtin/ | +6 | 0 replies | |
| 4/6 | worktree.c: use is_dot_or_dotdot()builtin/ worktree.c | +2 | 0 replies | |
| 5/6 | worktree: avoid 0{40}, too many zeroes, hard to readbuiltin/ | +1 | 0 replies | |
| 6/6 | worktree: simplify prefixing pathsbuiltin/ | +3 | 3 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.
Cover letter [PATCH v2 0/6] nd/worktree-cleanup-post-head-protection update
This is mostly commit message update plus
- dropping "--force" from the completion patch (a comment from Szeder Gabor in a previous attempt of worktree completion support).
- the removal of clear_worktree() patch.
I keep the completion patch anyway even though two versions of it were posted by Eric and Szeder (and didn't get discussed much) because I needed this for new commands and because I didn't aim high. It's meant to provide very basic completion support. Fancy stuff like ref completion can be added later by people who are more experienced in bash completion stuff.
Anyway, interdiff
-- 8< --
contrib/completion/git-completion.bash +1 -1
@@ -2604,7 +2604,7 @@ _git_worktree () else case "$subcommand,$cur" in add,--*) - __gitcomp "--detach --force" + __gitcomp "--detach" ;; list,--*) __gitcomp "--porcelain"
worktree.c +3 -11
@@ -5,22 +5,14 @@#include "dir.h" #include "wt-status.h" -void clear_worktree (struct worktree *wt) -{ -if (!wt) -return ; -free (wt->path); -free (wt->id); -free (wt->head_ref); -memset (wt,0 ,sizeof (*wt)); -} -void free_worktrees (struct worktree **worktrees) {int i =0 ;for (i =0 ; worktrees[i]; i++) { -clear_worktree (worktrees[i]); +free (worktrees[i]->path); +free (worktrees[i]->id); +free (worktrees[i]->head_ref);free (worktrees[i]); }free (worktrees);
worktree.h +0 -5
@@ -29,11 +29,6 @@ extern struct worktree **get_worktrees(void);*/ extern const char *get_worktree_git_dir (const struct worktree *wt); -/* -* Free up the memory for worktree -*/ -extern void clear_worktree (struct worktree *); -/* * Free up the memory for worktree(s) */
-- 8< --
Nguyễn Thái Ngọc Duy (6):
completion: support git-worktree
worktree.c: rewrite mark_current_worktree() to avoid strbuf git-worktree.txt: keep subcommand listing in alphabetical order worktree.c: use is_dot_or_dotdot()
worktree: avoid 0{40}, too many zeroes, hard to read
worktree: simplify prefixing paths
Documentation/git-worktree.txt | 10 +++++----- builtin/worktree.c | 10 ++++++---- contrib/completion/git-completion.bash | 23 +++++++++++++++++++++++ worktree.c | 18 ++++++++---------- 4 files changed, 42 insertions(+), 19 deletions(-)
Signature · 1 line
2.8.2.524.g6ff3d78