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

Re: [PATCH] Convert update-index references in docs to add.

From
Junio C Hamano <junkio@cox.net>
Date
Feb 17, 2007, 18:20 UTC
Message-ID
<7vvei0tzmx.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<20070217094342.GA496@spearce.org>
"Shawn O. Pearce" <spearce@spearce.org> writes:
Show 11 quoted lines
> Since `git add` is the approved porcelain for an end-user to invoke
> when they want to manipulate the index, porcelain documentation
> should steer the user to this command rather than the pure plumbing
> update-index.
>
> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
> ---
>
>  Maybe this isn't the best change to make.  I dunno.  I think it is
>  cleaner to keep the user looking at add instead of update-index,
>  but what do I know.  :-)

I think I agree with most of your changes, except in a few places we should suggest 'git rm' to resolve conflict as deletion of paths. On top of your patch, something like the attached.

One thing I suspect is that currently we refuse to 'git rm' if the index does not match working tree and HEAD, but it might make sense to skip that check when the path is unmerged in the index.

diff --git a/Documentation/git-checkout.txt b/Documentation/git-checkout.txt
index f65514e..1ae77be 100644
--- a/Documentation/git-checkout.txt
+++ b/Documentation/git-checkout.txt
@@ -61,7 +61,8 @@ OPTIONS
 +
 When a merge conflict happens, the index entries for conflicting
 paths are left unmerged, and you need to resolve the conflicts
-and mark the resolved paths with `git add`.
+and mark the resolved paths with `git add` (or `git rm` if the merge
+should result in deletion of the path).
 
 <new_branch>::
 	Name for the new branch.
diff --git a/Documentation/git-merge.txt b/Documentation/git-merge.txt
index 911c69b..9c08efa 100644
--- a/Documentation/git-merge.txt
+++ b/Documentation/git-merge.txt
@@ -136,7 +136,7 @@ After seeing a conflict, you can do two things:
 
  * Resolve the conflicts.  `git-diff` would report only the
    conflicting paths because of the above 2. and 3..  Edit the
-   working tree files into a desirable shape, `git-add`
+   working tree files into a desirable shape, `git-add` or `git-rm`
    them, to make the index file contain what the merge result
    should be, and run `git-commit` to commit the result.
 
diff --git a/Documentation/git-runstatus.txt b/Documentation/git-runstatus.txt
index e95662b..8bb52f4 100644
--- a/Documentation/git-runstatus.txt
+++ b/Documentation/git-runstatus.txt
@@ -16,7 +16,7 @@ DESCRIPTION
 Examines paths in the working tree that has changes unrecorded
 to the index file, and changes between the index file and the
 current HEAD commit.  The former paths are what you _could_
-commit by running 'git add' before running 'git
+commit by running 'git add' (or 'git rm' if you are deleting) before running 'git
 commit', and the latter paths are what you _would_ commit by
 running 'git commit'.
 
Previous: Shawn O. Pearce
Message 2 of 2 in “Convert update-index references in docs to add.”
  1. Convert update-index references in docs to add.Shawn O. Pearce, Feb 17, 2007
  2. Junio C HamanoFeb 17, 2007

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.