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

Re: git 1.8.0.rc0.18.gf84667d trouble with "git commit -p file"

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 11, 2012, 17:57 UTC
Message-ID
<7vmwzs7uyh.fsf@alter.siamese.dyndns.org>
In-Reply-To
<CAOTq_ptaXMUzSi-PomMa9K9-Fnus0pnsO+vq92ZnxfeRQZPAxw@mail.gmail.com>
Conrad Irwin <conrad.irwin@gmail.com> writes:
Show 8 quoted lines
>  -i::
>  --include::
> -	Before making a commit out of staged contents so far,
> -	stage the contents of paths given on the command line
> -	as well.  This is usually not what you want unless you
> -	are concluding a conflicted merge.
> +	In addition to the paths specified on the command line,
> +	include the current contents of the index in the commit.

"commit" is about committing what is in the index. include has always meant "in addition, include the contents of listed paths in the resulting commit".

The updated text looks totally the other way around.
Show 17 quoted lines
>  -o::
>  --only::
> -	Make a commit only from the paths specified on the
> -	command line, disregarding any contents that have been
> -	staged so far. This is the default mode of operation of
> -	'git commit' if any paths are given on the command line,
> -	in which case this option can be omitted.
> -	If this option is specified together with '--amend', then
> -	no paths need to be specified, which can be used to amend
> -	the last commit without committing changes that have
> -	already been staged.
> +	Only commit changes to the paths specified on the command line,
> +	do not include the current contents of the index. This is
> +	the default mode of operation when paths are specified.
> +	If this option is specified with --amend it can be used
> +	to reword the last commit without changing its contents.
> +	This mode cannot be used with --patch or --interactive.

The new text on this one does look cleaner and easier to read, at least to me, but "do not include the current contents" sounds as if you are recording a tree that only has Makefile and losing all the other files when you say "git commit Makefile".

    Disregard what has been added to the index since HEAD, and only
    commit changes to the given paths.
might be an improvement, but I dunno.
Previous: Conrad Irwin
Message 16 of 16 in “git 1.8.0.rc0.18.gf84667d trouble with "git commit -p file"”
  1. Horst H. von BrandOct 5, 2012
  2. Frans KlaverOct 5, 2012
  3. Junio C HamanoOct 5, 2012
  4. Jeff KingOct 5, 2012
  5. Junio C HamanoOct 6, 2012
  6. Jeff KingOct 6, 2012
  7. Junio C HamanoOct 6, 2012
  8. Jeff KingOct 6, 2012
  9. Conrad IrwinOct 6, 2012
  10. Jeff KingOct 6, 2012
  11. Junio C HamanoOct 7, 2012
  12. Jeff KingOct 7, 2012
  13. Junio C HamanoOct 7, 2012
  14. Jeff KingOct 7, 2012
  15. Conrad IrwinOct 11, 2012
  16. Junio C HamanoOct 11, 2012

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.