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

Re: [RFD/PATCH] add: ignore only ignored files

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
Nov 21, 2014, 15:39 UTC
Message-ID
<546F5CC7.8060904@drmicha.warpmail.net>
In-Reply-To
<20141120182012.GD2559@peff.net>
Jeff King schrieb am 20.11.2014 um 19:20:
Show 30 quoted lines
> On Thu, Nov 20, 2014 at 09:23:21AM -0800, Junio C Hamano wrote:
> 
>>> diff --git a/builtin/add.c b/builtin/add.c
>>> index ae6d3e2..1074e32 100644
>>> --- a/builtin/add.c
>>> +++ b/builtin/add.c
>>> @@ -284,7 +284,7 @@ static int add_files(struct dir_struct *dir, int flags)
>>>  		for (i = 0; i < dir->ignored_nr; i++)
>>>  			fprintf(stderr, "%s\n", dir->ignored[i]->name);
>>>  		fprintf(stderr, _("Use -f if you really want to add them.\n"));
>>> -		die(_("no files added"));
>>> +		exit_status = 1;
>>>  	}
>>>  
>>>  	for (i = 0; i < dir->nr; i++)
>>>
>>> It needs a tweak to t3700.35, which expects the "fatal:" line on stderr.
>>> But other than that, it passes all tests. So it must be good, right? :)
>>
>> ;-)
>>
>> It indeed is a behaviour change, but I do not expect it would be too
>> heavy a change to require us a transition period or major version
>> bump.  But because that is just my expectation, which is not what
>> real world users would expect, so I'd prefer to cook such a change
>> for at least a cycle and a half in 'next'.
> 
> Oh, definitely. Showing the patch at all was my not-so-subtle attempt to
> convince Michael to take over the topic so I did not have to worry about
> such things. :)

Well, given that I figured out how to do it with the option, it may come at no additional surprise that I figured out how to do it without the option, as well.

The real extra surprise is - not only that test fix is in my tree already - it even comes with a test that actually tests the new intended behavior. Whoaaa!

I'll resend it soon so that Jeff can take over and adjust the commit message ;)

Michael, just kidding
Previous: Jeff KingNext: Michael J Gruber
Message 9 of 22 in “add: ignore only ignored files”
  1. add: ignore only ignored filesMichael J Gruber, Nov 19, 2014
  2. Junio C HamanoNov 19, 2014
  3. Jeff KingNov 19, 2014
  4. Junio C HamanoNov 19, 2014
  5. Michael J GruberNov 20, 2014
  6. Jeff KingNov 20, 2014
  7. Junio C HamanoNov 20, 2014
  8. Jeff KingNov 20, 2014
  9. Michael J GruberNov 21, 2014
  10. [PATCHv2] add: ignore only ignored filesMichael J Gruber, Nov 21, 2014
  11. Jeff KingNov 21, 2014
  12. Torsten BögershausenNov 22, 2014
  13. Jeff KingNov 22, 2014
  14. Torsten BögershausenNov 22, 2014
  15. Jeff KingNov 23, 2014
  16. Junio C HamanoNov 23, 2014
  17. Jeff KingNov 23, 2014
  18. Junio C HamanoNov 24, 2014
  19. Torsten BögershausenNov 24, 2014
  20. Jeff KingNov 25, 2014
  21. Michael J GruberNov 24, 2014
  22. Michael J GruberNov 24, 2014

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.