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

Re: [PATCH 2/2] apply: add --intent-to-add

From
Junio C Hamano <gitster@pobox.com>
Date
May 21, 2018, 03:14 UTC
Message-ID
<xmqqa7st3dk4.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<20180520063424.GA3062@duynguyen.home>
Duy Nguyen <pclouds@gmail.com> writes:
Show 11 quoted lines
>> >  	if (state->check_index && is_not_gitdir)
>> >  		return error(_("--index outside a repository"));
>> > +	if (state->set_ita && is_not_gitdir)
>> > +		state->set_ita = 0;
>> 
>> I think this should error out, just like one line above does.
>> "I-t-a" is impossible without having the index, just like "--index"
>> is impossible without having the index.
>
> I was hoping to put this in an alias that works both with or without a
> repository. Do you feel strongly about this? 

"git apply --index" that silently applied only to the filesystem files without telling me that I am in a wrong directory by mistake is a UI disaster, and that is what the existing error we see in the pre context is about. I do not think of a good reason why "git apply --i-t-a" should behave any differently.

Previous: Duy NguyenNext: Jonathan Nieder
Message 5 of 15 in “diff: turn --ita-invisible-in-index on by default”
  1. 1/2 diff: turn --ita-invisible-in-index on by defaultNguyễn Thái Ngọc Duy, May 13, 2018
  2. 2/2 apply: add --intent-to-addNguyễn Thái Ngọc Duy, May 13, 2018
  3. Junio C HamanoMay 14, 2018
  4. Duy NguyenMay 20, 2018
  5. Junio C HamanoMay 21, 2018
  6. Jonathan NiederMay 25, 2018
  7. Duy NguyenMay 25, 2018
  8. Jonathan NiederMay 25, 2018
  9. Duy NguyenMay 25, 2018
  10. 0/4 Fix i-t-a entries in git-diff and git-applyNguyễn Thái Ngọc Duy, May 26, 2018
  11. 2/4 diff: turn --ita-invisible-in-index on by defaultNguyễn Thái Ngọc Duy, May 26, 2018
  12. 1/4 diff: ignore --ita-[in]visible-in-index when diffing worktree-to-treeNguyễn Thái Ngọc Duy, May 26, 2018
  13. Eric SunshineMay 27, 2018
  14. 3/4 t2203: add a test about "diff HEAD" caseNguyễn Thái Ngọc Duy, May 26, 2018
  15. 4/4 apply: add --intent-to-addNguyễn Thái Ngọc Duy, May 26, 2018

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.