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

jn/add-2.0-u-A-sans-pathspec (Re: What's cooking in git.git (Mar 2013, #07; Tue, 26))

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Mar 27, 2013, 22:25 UTC
Message-ID
<20130327222516.GI28148@google.com>
In-Reply-To
<7vy5d8jz0y.fsf@alter.siamese.dyndns.org>
Junio C Hamano wrote:
> On Tue, Mar 26, 2013 at 03:40:00PM -0700, Junio C Hamano wrote:
Show 14 quoted lines
>> * jn/add-2.0-u-A-sans-pathspec (2013-03-20) 5 commits
>>  - git add: -u/-A now affects the entire working tree
>>  - add -A: only show pathless 'add -A' warning when changes exist outside cwd
>>  - add -u: only show pathless 'add -u' warning when changes exist outside cwd
>>  - add: make warn_pathless_add() a no-op after first call
>>  - add: make pathless 'add [-u|-A]' warning a file-global function
>>
>>  Replaces jc/add-2.0-u-A-sans-pathspec topic by not warning against
>>  "add -u/-A" that is ran without pathspec when there is no change
>>  outside the current directory.
>
> I recall we had a lengthy discussion on this, but how committed are
> we on the progression of this series?  Are the bottom four ready to
> be merged to 1.8.3, or do they need more polishing?

I wanted to add tests and then other tasks took over. Sorry. Probably best to get the bottom four in "next" and add tests on top later.

I have the following squashed in locally.
-- >8 --
Subject: fixup! add -u: only show pathless 'add -u' warning when changes exist outside cwd

Define ADD_CACHE_IMPLICIT_DOT in cache.h alongside the other add_to_index flags. This way, authors of patches adding new flags that might want to use the same bit can know to be careful.

Requested-by: Jeff King <peff@peff.net>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
Thanks,
Jonathan
 builtin/add.c | 1 -
 cache.h       | 1 +
 2 files changed, 1 insertion(+), 1 deletion(-)
diff --git a/builtin/add.c b/builtin/add.c
index ad59182..9f35df7 100644
--- a/builtin/add.c
+++ b/builtin/add.c
@@ -139,7 +139,6 @@ static void update_callback(struct diff_queue_struct *q,
 	}
 }
 
-#define ADD_CACHE_IMPLICIT_DOT 32
 int add_files_to_cache(const char *prefix, const char **pathspec, int flags)
 {
 	struct update_callback_data data;
diff --git a/cache.h b/cache.h
index e493563..5de3480 100644
--- a/cache.h
+++ b/cache.h
@@ -459,6 +459,7 @@ extern int remove_file_from_index(struct index_state *, const char *path);
 #define ADD_CACHE_IGNORE_ERRORS	4
 #define ADD_CACHE_IGNORE_REMOVAL 8
 #define ADD_CACHE_INTENT 16
+#define ADD_CACHE_IMPLICIT_DOT 32	/* internal to "git add -u/-A" */
 extern int add_to_index(struct index_state *, const char *path, struct stat *, int flags);
 extern int add_file_to_index(struct index_state *, const char *path, int flags);
 extern struct cache_entry *make_cache_entry(unsigned int mode, const unsigned char *sha1, const char *path, int stage, int refresh);
-- 
1.8.2.rc3
Previous: Junio C HamanoNext: Thomas Rast
Message 11 of 12 in “What's cooking in git.git (Mar 2013, #07; Tue, 26)”
  1. Junio C HamanoMar 26, 2013
  2. Jeff KingMar 27, 2013
  3. Junio C HamanoMar 27, 2013
  4. Jeff KingMar 27, 2013
  5. Thomas RastMar 27, 2013
  6. Junio C HamanoMar 27, 2013
  7. John KeepingMar 27, 2013
  8. Junio C HamanoMar 27, 2013
  9. John KeepingMar 27, 2013
  10. Junio C HamanoMar 28, 2013
  11. jn/add-2.0-u-A-sans-pathspec (Re: What's cooking in git.git (Mar 2013, #07; Tue, 26))Jonathan Nieder, Mar 27, 2013
  12. Thomas RastMar 28, 2013

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.