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

[PATCH] git add -e documentation: rephrase note

From
Miklos Vajna <vmiklos@frugalware.org>
Date
Oct 19, 2009, 00:09 UTC
Message-ID
<20091019000900.GV6115@genesis.frugalware.org>
In-Reply-To
<20091014230434.GB29664@coredump.intra.peff.net>

Add a quick overview about what is OK and what is not to cover all cases.

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Jeff King <peff@peff.net>
---
On Wed, Oct 14, 2009 at 07:04:34PM -0400, Jeff King <peff@peff.net> wrote:
> Maybe it makes sense instead to do a quick overview of what is OK and
> what is not (like the list above).
Here it is.
 Documentation/git-add.txt |   18 +++++++++++++++---
 1 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/Documentation/git-add.txt b/Documentation/git-add.txt
index 45ebf87..1ea074c 100644
--- a/Documentation/git-add.txt
+++ b/Documentation/git-add.txt
@@ -86,9 +86,21 @@ OPTIONS
 	edit it.  After the editor was closed, adjust the hunk headers
 	and apply the patch to the index.
 +
-*NOTE*: Obviously, if you change anything else than the first character
-on lines beginning with a space or a minus, the patch will no longer
-apply.
+The intent of this option is to pick and choose lines of the diff to
+apply, or even to munge the lines. So it is safe to:
++
+* remove lines with a "+" (don't stage the addition)
+* munge any lines with a "+" (stage modified contents)
+* add lines with a "+" (stage an addition)
+* convert lines with a " " to "-" (stage removal)
+* convert lines with a "-" to " " (don't stage removal)
++
+It is a bad idea to:
++
+* delete "-" lines
+* delete " " lines
+* add " " or "-" lines
+* munge the contents of " " or "-" lines
 
 -u::
 --update::
-- 
1.6.5
Previous: Jeff KingNext: Jeff King
Message 3 of 10 in “git add -e documentation: rephrase note”
  1. git add -e documentation: rephrase noteMiklos Vajna, Oct 14, 2009
  2. Jeff KingOct 14, 2009
  3. git add -e documentation: rephrase noteMiklos Vajna, Oct 19, 2009
  4. Jeff KingOct 19, 2009
  5. Jeff KingOct 19, 2009
  6. Junio C HamanoOct 19, 2009
  7. Jeff KingOct 19, 2009
  8. Junio C HamanoOct 19, 2009
  9. Wesley J. LandakerOct 19, 2009
  10. Junio C HamanoOct 20, 2009

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.