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

Re: [PATCH 1/1] attr: add builtin objectmode values support

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 16, 2023, 07:57 UTC
Message-ID
<xmqqmsveqgex.fsf@gitster.g>
In-Reply-To
<20231116054437.2343549-1-jojwang@google.com>
Joanna Wang <jojwang@google.com> writes:
Show 16 quoted lines
> diff --git a/t/t6135-pathspec-with-attrs.sh b/t/t6135-pathspec-with-attrs.sh
> index a9c1e4e0ec..b08a32ea68 100755
> --- a/t/t6135-pathspec-with-attrs.sh
> +++ b/t/t6135-pathspec-with-attrs.sh
> @@ -295,4 +295,29 @@ test_expect_success 'reading from .gitattributes in a subdirectory (3)' '
>  	test_cmp expect actual
>  '
>  
> +test_expect_success 'pathspec with builtin_objectmode attr can be used' '
> +	>mode_exec_file_1 &&
> +
> +	git status -s ":(attr:builtin_objectmode=100644)mode_exec_*" >actual &&
> +	echo ?? mode_exec_file_1 >expect &&
> +	test_cmp expect actual &&
> +
> +	git add mode_exec_file_1 && chmod +x mode_exec_file_1 &&

This again would break with filesystems that are incapable of supporting executable bit natively. Writing one command per line, doing something like this may help

	git add mode_exec_file_1 &&
	git update-index --chmod=+x mode_exec_file_1 &&
Show 8 quoted lines
> +	git status -s ":(attr:builtin_objectmode=100755)mode_exec_*" >actual &&
> +	echo AM mode_exec_file_1 >expect &&
> +	test_cmp expect actual
> +'
> +
> +test_expect_success 'builtin_objectmode attr can be excluded' '
> +	>mode_1_regular &&
> +	>mode_1_exec  && chmod +x mode_1_exec &&
Ditto.
Show 10 quoted lines
> +	git status -s ":(exclude,attr:builtin_objectmode=100644)" "mode_1_*" >actual &&
> +	echo ?? mode_1_exec >expect &&
> +	test_cmp expect actual &&
> +
> +	git status -s ":(exclude,attr:builtin_objectmode=100755)" "mode_1_*" >actual &&
> +	echo ?? mode_1_regular >expect &&
> +	test_cmp expect actual
> +'
> +
>  test_done
Previous: Joanna Wang
Message 15 of 15 in “Re: [PATCH 1/1] attr: add native file mode values support”
  1. Joanna WangNov 14, 2023
  2. Junio C HamanoNov 14, 2023
  3. 1/1 attr: add builtin objectmode values supportJoanna Wang, Nov 14, 2023
  4. Junio C HamanoNov 16, 2023
  5. Eric SunshineNov 16, 2023
  6. Junio C HamanoNov 16, 2023
  7. 1/1 attr: add builtin objectmode values supportJoanna Wang, Nov 16, 2023
  8. Junio C HamanoNov 16, 2023
  9. Junio C HamanoNov 16, 2023
  10. Joanna WangNov 16, 2023
  11. Joanna WangDec 1, 2023
  12. Junio C HamanoDec 12, 2023
  13. Junio C HamanoDec 20, 2023
  14. Joanna WangJan 12, 2024
  15. Junio C HamanoNov 16, 2023

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.