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

Re: [PATCH v3 1/2] stash show: teach --include-untracked and --only-untracked

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 17, 2021, 02:31 UTC
Message-ID
<xmqqeehfmnmg.fsf@gitster.g>
In-Reply-To
<85b81f2f06bd1b40ee2de220cc84dd74b425daf3.1613459475.git.liu.denton@gmail.com>
Denton Liu <liu.denton@gmail.com> writes:
Show 18 quoted lines
> diff --git a/t/t3905-stash-include-untracked.sh b/t/t3905-stash-include-untracked.sh
> index b26a97aef4..978bc97baf 100755
> --- a/t/t3905-stash-include-untracked.sh
> +++ b/t/t3905-stash-include-untracked.sh
> @@ -297,4 +297,88 @@ test_expect_success 'stash -u with globs' '
>  	test_path_is_missing untracked.txt
>  '
>  
> +test_expect_success 'stash show --include-untracked shows untracked files' '
> + ...
> +	cat >expect <<-EOF &&
> +	diff --git a/tracked b/tracked
> +	new file mode 100644
> +	index 0000000..e69de29
> +	diff --git a/untracked b/untracked
> +	new file mode 100644
> +	index 0000000..e69de29
> +	EOF
We'd need this on top.
Thanks.
----- >8 ---------- >8 ---------- >8 ---------- >8 -----
Subject: [PATCH] SQUASH???
 t/t3905-stash-include-untracked.sh | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/t/t3905-stash-include-untracked.sh b/t/t3905-stash-include-untracked.sh
index 8bcd4c5ca8..a706ab80a5 100755
--- a/t/t3905-stash-include-untracked.sh
+++ b/t/t3905-stash-include-untracked.sh
@@ -303,6 +303,7 @@ test_expect_success 'stash show --include-untracked shows untracked files' '
 	>untracked &&
 	>tracked &&
 	git add tracked &&
+	empty_blob_oid=$(git rev-parse --short :tracked) &&
 	git stash -u &&
 
 	cat >expect <<-EOF &&
@@ -324,10 +325,10 @@ test_expect_success 'stash show --include-untracked shows untracked files' '
 	cat >expect <<-EOF &&
 	diff --git a/tracked b/tracked
 	new file mode 100644
-	index 0000000..e69de29
+	index 0000000..$empty_blob_oid
 	diff --git a/untracked b/untracked
 	new file mode 100644
-	index 0000000..e69de29
+	index 0000000..$empty_blob_oid
 	EOF
 	git stash show -p --include-untracked >actual &&
 	test_cmp expect actual &&
@@ -341,6 +342,7 @@ test_expect_success 'stash show --only-untracked only shows untracked files' '
 	>untracked &&
 	>tracked &&
 	git add tracked &&
+	empty_blob_oid=$(git rev-parse --short :tracked) &&
 	git stash -u &&
 
 	cat >expect <<-EOF &&
@@ -357,7 +359,7 @@ test_expect_success 'stash show --only-untracked only shows untracked files' '
 	cat >expect <<-EOF &&
 	diff --git a/untracked b/untracked
 	new file mode 100644
-	index 0000000..e69de29
+	index 0000000..$empty_blob_oid
 	EOF
 	git stash show -p --only-untracked >actual &&
 	test_cmp expect actual &&
-- 
2.30.1-684-g310d03ec1a
Previous: Junio C HamanoNext: Denton Liu
Message 38 of 45 in “stash show: learn --include-untracked and --only-untracked”
  1. 0/9 stash show: learn --include-untracked and --only-untrackedDenton Liu, Feb 2, 2021
  2. 1/9 git-stash.txt: be explicit about subcommand optionsDenton Liu, Feb 2, 2021
  3. Eric SunshineFeb 2, 2021
  4. 4/9 t3905: remove nested git in command substitutionDenton Liu, Feb 2, 2021
  5. 2/9 t3905: remove spaces after redirect operatorsDenton Liu, Feb 2, 2021
  6. 3/9 t3905: move all commands into test casesDenton Liu, Feb 2, 2021
  7. Junio C HamanoFeb 2, 2021
  8. 5/9 t3905: replace test -s with test_file_not_emptyDenton Liu, Feb 2, 2021
  9. 8/9 stash show: teach --include-tracked and --only-untrackedDenton Liu, Feb 2, 2021
  10. Junio C HamanoFeb 2, 2021
  11. 9/9 stash show: learn stash.showIncludeUntrackedDenton Liu, Feb 2, 2021
  12. 7/9 stash: declare ref_stash as an arrayDenton Liu, Feb 2, 2021
  13. Junio C HamanoFeb 2, 2021
  14. 6/9 t3905: use test_cmp() to check file contentsDenton Liu, Feb 2, 2021
  15. 0/9 stash show: learn --include-untracked and --only-untrackedDenton Liu, Feb 9, 2021
  16. 1/9 git-stash.txt: be explicit about subcommand optionsDenton Liu, Feb 9, 2021
  17. Junio C HamanoFeb 10, 2021
  18. fixup! git-stash.txt: be explicit about subcommand optionsDenton Liu, Feb 11, 2021
  19. 2/9 t3905: remove spaces after redirect operatorsDenton Liu, Feb 9, 2021
  20. Junio C HamanoFeb 10, 2021
  21. 3/9 t3905: move all commands into test casesDenton Liu, Feb 9, 2021
  22. 4/9 t3905: remove nested git in command substitutionDenton Liu, Feb 9, 2021
  23. Junio C HamanoFeb 10, 2021
  24. 5/9 t3905: replace test -s with test_file_not_emptyDenton Liu, Feb 9, 2021
  25. 6/9 t3905: use test_cmp() to check file contentsDenton Liu, Feb 9, 2021
  26. 8/9 stash show: teach --include-untracked and --only-untrackedDenton Liu, Feb 9, 2021
  27. Junio C HamanoFeb 10, 2021
  28. Denton LiuFeb 16, 2021
  29. Junio C HamanoFeb 16, 2021
  30. 7/9 stash: declare ref_stash as an arrayDenton Liu, Feb 9, 2021
  31. Junio C HamanoFeb 10, 2021
  32. 9/9 stash show: learn stash.showIncludeUntrackedDenton Liu, Feb 9, 2021
  33. 0/2 stash show: learn --include-untracked and --only-untrackedDenton Liu, Feb 16, 2021
  34. 1/2 stash show: teach --include-untracked and --only-untrackedDenton Liu, Feb 16, 2021
  35. Junio C HamanoFeb 16, 2021
  36. Denton LiuFeb 17, 2021
  37. Junio C HamanoFeb 17, 2021
  38. Junio C HamanoFeb 17, 2021
  39. 2/2 stash show: learn stash.showIncludeUntrackedDenton Liu, Feb 16, 2021
  40. 0/2 stash show: learn --include-untracked and --only-untrackedDenton Liu, Mar 3, 2021
  41. 2/2 stash show: learn stash.showIncludeUntrackedDenton Liu, Mar 3, 2021
  42. 1/2 stash show: teach --include-untracked and --only-untrackedDenton Liu, Mar 3, 2021
  43. Junio C HamanoMar 4, 2021
  44. Denton LiuMar 4, 2021
  45. Denton LiuMar 4, 2021

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.