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

Re: [RFC 0/6] git-check-attr should work for relative paths

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 2, 2011, 22:02 UTC
Message-ID
<7vwrevcw12.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1311849425-9057-1-git-send-email-mhagger@alum.mit.edu>

A minor compilation fix-up on top, to be squashed when the series is re-rolled.

diff --git a/builtin/check-attr.c b/builtin/check-attr.c
index 23a6e07..8155b3d 100644
--- a/builtin/check-attr.c
+++ b/builtin/check-attr.c
@@ -44,7 +44,7 @@ static void output_attr(int cnt, struct git_attr_value *check,
 static void check_attr(const char *prefix, int cnt,
 	struct git_attr_value *check, const char *file)
 {
-	const char *full_path =
+	char *full_path =
 		prefix_path(prefix, prefix ? strlen(prefix) : 0, file);
 	if (check != NULL) {
 		if (git_checkattr(full_path, cnt, check))
diff --git a/test-path-utils.c b/test-path-utils.c
index 471406c..3bc20e9 100644
--- a/test-path-utils.c
+++ b/test-path-utils.c
@@ -36,10 +36,10 @@ int main(int argc, char **argv)
 	}
 
 	if (argc >= 4 && !strcmp(argv[1], "prefix_path")) {
-		int nongit_ok;
-		setup_git_directory_gently(&nongit_ok);
 		char *prefix = argv[2];
 		int prefix_len = strlen(prefix);
+		int nongit_ok;
+		setup_git_directory_gently(&nongit_ok);
 		while (argc > 3) {
 			puts(prefix_path(prefix, prefix_len, argv[3]));
 			argc--;
Previous: Michael HaggertyNext: Michael Haggerty
Message 14 of 15 in “[RFC 0/6] git-check-attr should work for relative paths”
  1. Michael HaggertyJul 28, 2011
  2. 1/6 git-check-attr: test that no output is written to stderrMichael Haggerty, Jul 28, 2011
  3. 2/6 git-check-attr: Demonstrate problems with unnormalized pathsMichael Haggerty, Jul 28, 2011
  4. 3/6 git-check-attr: Demonstrate problems with relative pathsMichael Haggerty, Jul 28, 2011
  5. 4/6 git-check-attr: Normalize pathsMichael Haggerty, Jul 28, 2011
  6. Junio C HamanoAug 2, 2011
  7. Michael HaggertyAug 4, 2011
  8. Junio C HamanoAug 4, 2011
  9. Michael HaggertyAug 5, 2011
  10. Junio C HamanoAug 5, 2011
  11. Michael HaggertyAug 7, 2011
  12. 5/6 test-path-utils: Add subcommand "absolute_path"Michael Haggerty, Jul 28, 2011
  13. 6/6 test-path-utils: Add subcommand "prefix_path"Michael Haggerty, Jul 28, 2011
  14. Junio C HamanoAug 2, 2011
  15. Michael HaggertyAug 4, 2011

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.