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

Re: Two crazy proposals for changing git's diff commands

From
Junio C Hamano <junkio@cox.net>
Date
Feb 10, 2006, 09:05 UTC
Message-ID
<7vmzgzy46f.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<Pine.LNX.4.64.0602081726390.2458@g5.osdl.org>
Linus Torvalds <torvalds@osdl.org> writes:
> Under that logic, "git status -v" would show all the diffs (not just 
> filenames) and "git commit -v .." would be the same as "git commit .." but 
> the "-v" flag would have been passed down to the "git status" call, so the 
> commit message file would be pre-populated with the diff.
Now that is done and sitting at the tip of "next".
> For small commits, it's actually nice to see the diff itself as you write 
> the commit message.

Yes, that is my experience, and even with fairly big one, it is pleasant as long as your editor allows you to C-x 2 C-x o around the file you are editing, like "em" ;-).

commit cf7bb589af739563c90dc32b4901bea73aaaa9d0
Author: Junio C Hamano <junkio@cox.net>
Date:   Fri Feb 10 00:45:59 2006 -0800
    git-status -v
    
    This revamps the git-status command to take the same set of
    parameters as git commit.  It gives a preview of what is being
    committed with that command.  With -v flag, it shows the diff
    output between the HEAD commit and the index that would be
    committed if these flags were given to git-commit command.
    
    git-commit also acquires -v flag (it used to mean "verify" but
    that is the default anyway and there is --no-verify to turn it
    off, so not much is lost), which uses the updated git-status -v
    to seed the commit log buffer.  This is handy for writing a log
    message while reviewing the changes one last time.
    
    Now, git-commit and git-status internally share the same
    implementation.
    
    Unlike previous git-commit change, this uses a temporary index
    to prepare the index file that would become the real index file
    after a successful commit, and moves it to the real index file
    once the commit is actually made.  This makes it safer than the
    previous scheme, which stashed away the original index file and
    restored it after an aborted commit.
    
    Signed-off-by: Junio C Hamano <junkio@cox.net>
Previous: Junio C HamanoNext: Carl Worth
Message 10 of 30 in “Two crazy proposals for changing git's diff commands”
  1. Carl WorthFeb 9, 2006
  2. Linus TorvaldsFeb 9, 2006
  3. Linus TorvaldsFeb 9, 2006
  4. Carl WorthFeb 9, 2006
  5. Junio C HamanoFeb 9, 2006
  6. Junio C HamanoFeb 9, 2006
  7. Junio C HamanoFeb 9, 2006
  8. Linus TorvaldsFeb 9, 2006
  9. Junio C HamanoFeb 9, 2006
  10. Junio C HamanoFeb 10, 2006
  11. Comments on "status -v" (was: Two crazy proposals for changing git's diff commands)Carl Worth, Feb 10, 2006
  12. Junio C HamanoFeb 10, 2006
  13. Linus TorvaldsFeb 10, 2006
  14. Junio C HamanoFeb 10, 2006
  15. Petr BaudisFeb 10, 2006
  16. Junio C HamanoFeb 10, 2006
  17. Carl WorthFeb 9, 2006
  18. Junio C HamanoFeb 10, 2006
  19. Carl WorthFeb 10, 2006
  20. Junio C HamanoFeb 10, 2006
  21. Carl WorthFeb 10, 2006
  22. Mark WoodingFeb 10, 2006
  23. Catalin MarinasFeb 13, 2006
  24. Prune-safe StGIT (was Re: Two crazy proposals for changing git's diff commands)Catalin Marinas, Feb 13, 2006
  25. Kent EngstromFeb 10, 2006
  26. Junio C HamanoFeb 11, 2006
  27. Add howto about separating topics.kent@lysator.liu.se, Feb 12, 2006
  28. J. Bruce FieldsFeb 12, 2006
  29. Junio C HamanoFeb 12, 2006
  30. Tim LarsonFeb 9, 2006

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.