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

RE: git with custom diff for commits

From
GGGerald Gutierrez <ggmlfs@gmail.com>
Date
Dec 18, 2007, 22:27 UTC
Message-ID
<000d01c841c5$386f7350$762a14ac@na.acco.com>
In-Reply-To
<vpqsl1zfz8r.fsf@bauges.imag.fr>
> What you seem to expect is to tell git "commit the changes 
> except this portion", what you have to tell git is actually 
> "commit the new state, but not if this portion is the only 
> change". That sounds identical, but it's actually a bit different.
It's not what I'm saying.

Here's what the git-commit manpage on kernel.org says: "git-commit - Record changes to the repository".

What I am saying is that if the user defines a custom diff, it is reasonable to believe that the user wants to teach git a new definition of "changes". If that new definition says that the files have changed, then go ahead and commit the new state. If that definition says there are no changes, then there is nothing to commit. In other words:

if (user_redefined_changed)
  if (user_defn_of_changed(work, head)) commit(work);
else
  if (builtin_changed(work, head)) commit(work);

As it is, it's not a big deal to me. Instead of teaching git the different concept of "changes", I teach the script that runs git instead. But teaching git directly just seems cleaner and more intuitive.

Gerald.
Previous: Matthieu MoyNext: Johannes Schindelin
Message 16 of 24 in “git with custom diff for commits”
  1. Gerald GutierrezDec 17, 2007
  2. Johannes SchindelinDec 17, 2007
  3. Matthieu MoyDec 17, 2007
  4. Johannes SchindelinDec 17, 2007
  5. Junio C HamanoDec 17, 2007
  6. Matthieu MoyDec 18, 2007
  7. Junio C HamanoDec 18, 2007
  8. Gerald GutierrezDec 18, 2007
  9. Junio C HamanoDec 18, 2007
  10. Gerald GutierrezDec 18, 2007
  11. Johannes SchindelinDec 18, 2007
  12. Gerald GutierrezDec 18, 2007
  13. Johannes SchindelinDec 18, 2007
  14. Junio C HamanoDec 18, 2007
  15. Matthieu MoyDec 18, 2007
  16. Gerald GutierrezDec 18, 2007
  17. Johannes SchindelinDec 18, 2007
  18. Martin LanghoffDec 18, 2007
  19. Matthieu MoyDec 19, 2007
  20. Johannes SchindelinDec 19, 2007
  21. Matthieu MoyDec 19, 2007
  22. Matthieu MoyDec 19, 2007
  23. Gerald GutierrezDec 18, 2007
  24. Gerald GutierrezDec 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.