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

Re: merge time

From
Shawn O. Pearce <spearce@spearce.org>
Date
Jul 30, 2007, 07:49 UTC
Message-ID
<20070730074937.GT20052@spearce.org>
In-Reply-To
<E49A2B0B-DAA3-4A03-925D-D3D113F907F1@zib.de>
Steffen Prohaska <prohaska@zib.de> wrote:
Show 6 quoted lines
> Another option could be to force a commit before the merge, even
> if there are no changes to commit, something like
> 
>     $ git commit --force -m 'MARK'
> 
> [to my knowledge, --force or similar is not yet available]
git-force-commit:
  git config --global alias.force-commit \
  '! git update-ref HEAD $(echo MARK | git commit-tree HEAD -p HEAD)'
But you didn't hear it from me.  ;-)

Yes, I've actually done this once in a while. But only to create some temporary throw-away state that I need for some diff operation or whatnot. Usually because I make it in one repository, but want to fetch it into another and fetch likes moving refs to commits better than refs to trees. Oh, and I'm usually passing in more than one -p, and usually not HEAD as the tree. But whatever.

-- 
Shawn.
Previous: Steffen ProhaskaNext: Steffen Prohaska
Message 16 of 35 in “merge time”
  1. Matthew L FosterJul 29, 2007
  2. Jakub NarebskiJul 29, 2007
  3. Linus TorvaldsJul 29, 2007
  4. Matthew L FosterJul 30, 2007
  5. david@lang.hmJul 30, 2007
  6. Linus TorvaldsJul 30, 2007
  7. Matthew L FosterJul 30, 2007
  8. Linus TorvaldsJul 30, 2007
  9. Linus TorvaldsJul 30, 2007
  10. Matthew L FosterJul 30, 2007
  11. SeanJul 30, 2007
  12. Matthew L FosterJul 30, 2007
  13. Steffen ProhaskaJul 30, 2007
  14. Junio C HamanoJul 30, 2007
  15. Steffen ProhaskaJul 30, 2007
  16. Shawn O. PearceJul 30, 2007
  17. Steffen ProhaskaJul 30, 2007
  18. Jeff KingJul 30, 2007
  19. Junio C HamanoJul 30, 2007
  20. Jeff KingJul 30, 2007
  21. Steffen ProhaskaJul 30, 2007
  22. Jeff KingJul 30, 2007
  23. david@lang.hmJul 30, 2007
  24. Jeff KingJul 30, 2007
  25. Linus TorvaldsJul 30, 2007
  26. Steffen ProhaskaJul 31, 2007
  27. david@lang.hmJul 31, 2007
  28. Rogan DawesJul 30, 2007
  29. Matthew L FosterJul 30, 2007
  30. Johannes SchindelinJul 30, 2007
  31. Matthew L FosterJul 30, 2007
  32. Rogan DawesJul 30, 2007
  33. Matthew L FosterJul 30, 2007
  34. david@lang.hmJul 30, 2007
  35. Jakub NarebskiJul 30, 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.