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
Oct 22, 2010, 21:54 UTC
Message-ID
<7v8w1plwq0.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20101022192529.GA13059@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 28 quoted lines
> Perhaps the list should be structured not as "what you can do to each
> line" but rather "here are some _concepts_ you might see, here's how
> they are represented, and how you might want to edit them". So
> basically:
>
>   - added lines; represented by "+" lines. You can prevent staging any
>     addition lines by deleting them.
>
>   - removed lines; represented by "-" lines. You can prevent staging any
>     removal lines by converting "-" to " ".
>
>   - modified lines; represented by "-" followed by "+". You can prevent
>     staging the modification by converting the "-" to a " ", and
>     removing the "+" lines. And this would be a good place to warn that
>     just deleting half of the pair is going to cause problems.
>
>   - existing lines; represented by " " lines. You can:
>
>       - remove them, by converting " " to "-".
>
>       - modify them, by converting " " to "-", and adding a new "+" line
>         with the new content.
>
>   - adding new lines; do not yet exist in the patch. You can add new
>     lines by inserting "+" lines with the new content.
>
> which is perhaps better, as it directs the user according to what they
> actually want to accomplish.

Yes, the above reads much better than starting from "when you see a '+' you can do..." (which I think is a wrong approach that is backwards).

Show 7 quoted lines
>> Is there a way to move this note way upwards?  Once the reader understands
>> what this paragraph teaches, it becomes much easier to understand the
>> implication of "remove addition".
>
> I agree it would be better at the top, but I think formatting it as I
> just wrote above would mean we can actually explain the issue in a more
> appropriate place. And then this bottom warning can just go away.
Agreed, again.
Previous: Jeff KingNext: Jeff King
Message 5 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.