pr-git-2281/HaraldNordgren/checkout-fetch-start-point-v15
tagged this
24 Jun 21:54
Extend checkout --track with a fetch mode to refresh start-point. Changes in v15: * Reword commit message to lead with motivation. * Drop RESOLVE_REF_NO_RECURSE so <ns>/HEAD lookup matches what git checkout does for the same ref. Drop redundant check_refname_format on a ref we just read. Replace memset with brace initializer. Use refs_ref_exists and pass NULL for the OID out-params. * Split the "set HEAD" error onto its own line via die_message and advise, matching the suggested format. * Remove 6 redundant tests, replace test $a = $b with test_cmp_rev, and rename test titles to avoid "namespace". Changes in v14: * Handle .h files in a better way. Changes in v13: * Create a preparatory commit that exposes find_tracking_remote_for_ref() and advise_ambiguous_fetch_refspec() from branch.c, so checkout can reuse the same lookup git branch --track uses. * Use advise_ambiguous_fetch_refspec() for the "multiple remotes match" case, so the wording matches git branch --track. Harald Nordgren (2): branch: expose helpers for finding the remote owning a tracking ref checkout: extend --track with a "fetch" mode to refresh start-point Documentation/git-checkout.adoc | 17 ++- Documentation/git-switch.adoc | 5 +- branch.c | 96 +++++++------- branch.h | 16 +++ builtin/checkout.c | 138 +++++++++++++++++++- t/t7201-co.sh | 222 ++++++++++++++++++++++++++++++++ 6 files changed, 443 insertions(+), 51 deletions(-) base-commit: ab776a62a78576513ee121424adb19597fbb7613 Submitted-As: https://lore.kernel.org/git/pull.2281.v15.git.git.1782338098.gitgitgadget@gmail.com In-Reply-To: https://lore.kernel.org/git/pull.2281.git.git.1777024991531.gitgitgadget@gmail.com In-Reply-To: https://lore.kernel.org/git/pull.2281.v2.git.git.1777140755373.gitgitgadget@gmail.com In-Reply-To: https://lore.kernel.org/git/pull.2281.v3.git.git.1777188295021.gitgitgadget@gmail.com In-Reply-To: https://lore.kernel.org/git/pull.2281.v4.git.git.1777228346809.gitgitgadget@gmail.com In-Reply-To: https://lore.kernel.org/git/pull.2281.v5.git.git.1777367012441.gitgitgadget@gmail.com In-Reply-To: https://lore.kernel.org/git/pull.2281.v6.git.git.1777847487823.gitgitgadget@gmail.com In-Reply-To: https://lore.kernel.org/git/pull.2281.v7.git.git.1778280727849.gitgitgadget@gmail.com In-Reply-To: https://lore.kernel.org/git/pull.2281.v8.git.git.1778507225500.gitgitgadget@gmail.com In-Reply-To: https://lore.kernel.org/git/pull.2281.v9.git.git.1778583307774.gitgitgadget@gmail.com In-Reply-To: https://lore.kernel.org/git/pull.2281.v10.git.git.1779091483321.gitgitgadget@gmail.com In-Reply-To: https://lore.kernel.org/git/pull.2281.v11.git.git.1779177508772.gitgitgadget@gmail.com In-Reply-To: https://lore.kernel.org/git/pull.2281.v12.git.git.1779358803652.gitgitgadget@gmail.com In-Reply-To: https://lore.kernel.org/git/pull.2281.v13.git.git.1779565714.gitgitgadget@gmail.com In-Reply-To: https://lore.kernel.org/git/pull.2281.v14.git.git.1781786652.gitgitgadget@gmail.com