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

Re: [PATCH] docs: give more hints about how "add -e" works

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 9, 2010, 00:57 UTC
Message-ID
<7vlj53nwjl.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20101108223322.GA12258@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
> It should replace what's in next. You can either start a new branch and
> revert what's in next, or I can prepare it on top of what's in next if
> you prefer.

I can just apply an interdiff if I wanted to, so that is no reason for asking a resend.

The new text indeed looks much clearer, except for one part I am not absolutely sure...

Show 10 quoted lines
> +new content::
> +
> +You may also add new content that does not exist in the patch. Simply
> +add new lines, each starting with "{plus}".
> +
> +You can also perform more complex operations, such as modifying the
> +content to be staged by a "{plus}" line. However, note that this impacts
> +_only_ the index; the working tree file will remain unchanged, and will
> +appear to "undo" the content you have staged. Such operations should be
> +performed only if you know what you are doing.

This "However, note that" part should apply not only to newly introduced {plus} lines but also to {plus} lines whose change were edited (lines from "added content" and from post-image half of "modified content"), no?

I tried to be careless when reading the two paragraphs above, and managed to get an incorrect impression that the caveat applies only to "more complex operations", even though it actually applies not just the previous "new content" but also "added/modified" content.

Thinking about it a bit more, it is worse than that. Turning " " into "-" has the same "getting reverted" issue, no?

Previous: Jeff KingNext: Jeff King
Message 7 of 10 in “docs: give more hints about how "add -e" works”
  1. docs: give more hints about how "add -e" worksJeff King, Oct 21, 2010
  2. Jonathan NiederOct 21, 2010
  3. Junio C HamanoOct 21, 2010
  4. Jeff KingOct 22, 2010
  5. Junio C HamanoOct 22, 2010
  6. Jeff KingNov 8, 2010
  7. Junio C HamanoNov 9, 2010
  8. Jeff KingNov 9, 2010
  9. Jeff KingNov 9, 2010
  10. Miklos VajnaOct 24, 2010

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.