git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] format-patch: clear UNINTERESTING flag before prepare_bases

From
Ye Xiaolong <xiaolong.ye@intel.com>
Date
Jun 19, 2018, 02:40 UTC
Message-ID
<20180619024054.GD17789@yexl-desktop>
In-Reply-To
<20180604150543.7304-1-xiaolong.ye@intel.com>
Hi, Junio
Could you help review this patch?

Thanks, Xiaolong

On 06/04, Xiaolong Ye wrote:
Show 51 quoted lines
>When users specify the commit range with 'Z..C' pattern for format-patch, all
>the parents of Z (including Z) would be marked as UNINTERESTING which would
>prevent revision walk in prepare_bases from getting the prerequisite commits,
>thus `git format-patch --base <base_commit_sha> Z..C` won't be able to generate
>the list of prerequisite patch ids. Clear UNINTERESTING flag with
>clear_object_flags solves this issue.
>
>Reported-by: Eduardo Habkost <ehabkost@redhat.com>
>Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
>---
> builtin/log.c           | 1 +
> t/t4014-format-patch.sh | 6 ++++--
> 2 files changed, 5 insertions(+), 2 deletions(-)
>
>diff --git a/builtin/log.c b/builtin/log.c
>index 4686f68594..01993de6fe 100644
>--- a/builtin/log.c
>+++ b/builtin/log.c
>@@ -1746,6 +1746,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
> 	if (base_commit || base_auto) {
> 		struct commit *base = get_base_commit(base_commit, list, nr);
> 		reset_revision_walk();
>+		clear_object_flags(UNINTERESTING);
> 		prepare_bases(&bases, base, list, nr);
> 	}
> 
>diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh
>index 028d5507a6..53880da7bb 100755
>--- a/t/t4014-format-patch.sh
>+++ b/t/t4014-format-patch.sh
>@@ -1554,13 +1554,15 @@ test_expect_success 'format-patch -o overrides format.outputDirectory' '
> 
> test_expect_success 'format-patch --base' '
> 	git checkout side &&
>-	git format-patch --stdout --base=HEAD~3 -1 | tail -n 7 >actual &&
>+	git format-patch --stdout --base=HEAD~3 -1 | tail -n 7 >actual1 &&
>+	git format-patch --stdout --base=HEAD~3 HEAD~.. | tail -n 7 >actual2 &&
> 	echo >expected &&
> 	echo "base-commit: $(git rev-parse HEAD~3)" >>expected &&
> 	echo "prerequisite-patch-id: $(git show --patch HEAD~2 | git patch-id --stable | awk "{print \$1}")" >>expected &&
> 	echo "prerequisite-patch-id: $(git show --patch HEAD~1 | git patch-id --stable | awk "{print \$1}")" >>expected &&
> 	signature >> expected &&
>-	test_cmp expected actual
>+	test_cmp expected actual1 &&
>+	test_cmp expected actual2
> '
> 
> test_expect_success 'format-patch --base errors out when base commit is in revision list' '
>-- 
>2.16.GIT
>
Previous: Eduardo HabkostNext: Stefan Beller
Message 8 of 9 in “format-patch: no 'prerequisite-patch-id' info when specifying commit range”
  1. Eduardo HabkostMay 29, 2018
  2. Ye XiaolongMay 30, 2018
  3. Ye XiaolongJun 3, 2018
  4. Junio C HamanoJun 4, 2018
  5. Ye XiaolongJun 4, 2018
  6. format-patch: clear UNINTERESTING flag before prepare_basesXiaolong Ye, Jun 4, 2018
  7. Eduardo HabkostJun 4, 2018
  8. Ye XiaolongJun 19, 2018
  9. Stefan BellerJun 19, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.