Re: What's cooking in git.git (Apr 2017, #02; draft as of Sat, 15)
Duy Nguyenwrites: >> * nd/worktree-add-lock (2017-04-15) 2 commits >> - SQUASH??? >> - worktree add: add --lock option >> > > Allow to lock a workktree immediately after it's created. This helps > prevent a race between "git worktree add; git worktree lock" and "git > worktree prune". Thanks. Also thanks for "we at least need to ensure the lock file is there" comment, which led to this: -- >8 -- From: Junio C Hamano Date: Sat, 15 Apr 2017 00:36:31 -0700 Subject: [PATCH] SQUASH??? --- builtin/worktree.c | 16 +++- t/t2025-worktree-add.sh | 2 +- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/builtin/worktree.c b/builtin/worktree.c index 3dab07c829..5ebdcce793 100644 --- a/builtin/worktree.c +++ b/builtin/worktree.c @@ -243,7 +243,10 @@ static int add_worktree(const char *path, const char *refname, * after the preparation is over. */ strbuf_addf(, "%s/locked", sb_repo.buf); - write_file(sb.buf, "initializing"); + if (!opts->keep_locked) + write_file(sb.buf, "initializing"); + else + write_file(sb.buf, "added with --lock"); strbuf_addf(_git, "%s/.git", path); if (safe_create_leading_directories_const(sb_git.buf)) @@ -306,15 +309,10 @@ static int add_worktree(const char *path, const char *refname, done: strbuf_reset(); strbuf_addf(, "%s/locked", sb_repo.buf); - if (!ret && opts->keep_locked) { - /* -* Don't keep the confusing "initializing" message -* after it's already over. -*/ - truncate(sb.buf, 0); - } else { + if (!ret && opts->keep_locked) + ; + else unlink_or_warn(sb.buf); - } argv_array_clear(_env); strbuf_release(); strbuf_release(); diff --git a/t/t2025-worktree-add.sh b/t/t2025-worktree-add.sh index 6dce920c03..b5c47ac602 100755 --- a/t/t2025-worktree-add.sh +++ b/t/t2025-worktree-add.sh @@ -66,7 +66,7 @@ test_expect_success '"add" worktree' ' test_expect_success '"add" worktree with lock' ' git rev-parse HEAD >expect && git worktree add --detach --lock here-with-lock master && - test_must_be_empty .git/worktrees/here-with-lock/locked + test -f .git/worktrees/here-with-lock/locked ' test_expect_success '"add" worktree from a subdir' ' -- 2.12.2-820-g9f56312714
Re: What's cooking in git.git (Apr 2017, #02; draft as of Sat, 15)
On Sat, Apr 15, 2017 at 5:14 PM, Junio C Hamanowrote: > * nd/conditional-config-include (2017-04-14) 2 commits > - config: resolve symlinks in conditional include's patterns > - path.c: and an option to call real_path() in expand_user_path() > $GIT_DIR may in some cases be normalized with all symlinks resolved while "gitdir" path expansion in the pattern does not receive the same treatment. This may lead to incorrect mismatch. > * nd/worktree-add-lock (2017-04-15) 2 commits > - SQUASH??? > - worktree add: add --lock option > Allow to lock a workktree immediately after it's created. This helps prevent a race between "git worktree add; git worktree lock" and "git worktree prune". -- Duy
What's cooking in git.git (Apr 2017, #02; draft as of Sat, 15)
This is not yet the second issue of this month, but is a draft. I haven't caught up with the list traffic yet, but have skimmed most of the discussion and even managed to pick up some new topics. Two requests to topic owners: - You'd notice that the topics in the New Topics section below do not have any usual two/three-line one-paragraph summary. If you can supply one for me, that would be helpful. - Please check what is queued from you (listed below in New topics section) to see if I picked up a stale one and you have a newer version that I should replace them with, in which case let me know the Message-Id of the latest. You can find the changes described here in the integration branches of the repositories listed at http://git-blame.blogspot.com/p/git-public-repositories.html -- [New Topics] * ah/diff-files-ours-theirs-doc (2017-04-13) 1 commit - diff-files: document --ours etc. * dt/xgethostname-nul-termination (2017-04-13) 1 commit - xgethostname: handle long hostnames * jh/string-list-micro-optim (2017-04-15) 1 commit - string-list: use ALLOC_GROW macro when reallocing string_list * jh/unpack-trees-micro-optim (2017-04-15) 1 commit - unpack-trees: avoid duplicate ODB lookups during checkout * jh/verify-index-checksum-only-in-fsck (2017-04-15) 1 commit - read-cache: force_verify_index_checksum * jk/no-looking-at-dotgit-outside-repo (2017-04-13) 1 commit - has_sha1_file: don't bother if we are not in a repository * ls/travis-doc-asciidoctor (2017-04-13) 3 commits - travis-ci: unset compiler for jobs that do not need one - travis-ci: parallelize documentation build - travis-ci: build documentation with AsciiDoc and Asciidoctor * mg/status-in-progress-info (2017-04-14) 1 commit - status: show in-progress info for short status * nd/conditional-config-include (2017-04-14) 2 commits - config: resolve symlinks in conditional include's patterns - path.c: and an option to call real_path() in expand_user_path() * nd/worktree-add-lock (2017-04-15) 2 commits - SQUASH??? - worktree add: add --lock option * ps/pathspec-empty-prefix-origin (2017-04-14) 1 commit - pathspec: honor `PATHSPEC_PREFIX_ORIGIN` with empty prefix * sb/submodule-rm-absorb (2017-04-13) 1 commit - submodule.c: add missing ' in error messages * sr/http-proxy-configuration-fix (2017-04-13) 2 commits - http: fix the silent ignoring of proxy misconfiguraion - http: honor empty http.proxy option to bypass proxy * tb/doc-eol-normalization (2017-04-13) 1 commit - gitattributes.txt: document how to normalize the line endings * va/i18n-perl-scripts (2017-04-13) 1 commit - git-add--interactive.perl: add missing dot in a message * bw/submodule-is-active (2017-04-13) 1 commit - submodule--helper: fix typo in is_active error message * gp/rebase-signoff (2017-04-15) 1 commit - rebase: pass --[no-]signoff option to git am * jh/add-index-entry-optim (2017-04-15) 3 commits - read-cache: speed up add_index_entry during checkout - p0006-read-tree-checkout: perf test to time read-tree - read-cache: add strcmp_offset function -- [Stalled] * sg/clone-refspec-from-command-line-config (2017-02-27) 1 commit - clone: respect configured fetch respecs during initial fetch Expecting a reroll. cf. <20170227211217.73gydlxb2qu2s...@sigill.intra.peff.net> cf.