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

[PATCH] Preserve ORIG_HEAD if already up-to-date with remote.

From
KGKunal Gangakhedkar <kunal.gangakhedkar@gmail.com>
Date
Jun 13, 2011, 07:35 UTC
Message-ID
<1307950525-8011-1-git-send-email-kunal.gangakhedkar@gmail.com>

By default, the ORIG_HEAD ref is moved to point to HEAD during a merge. If there are no changes (i.e. if the local is in sync with remote), it becomes difficult to see the last set of changes as the range of commits is lost.

This is especially true when the pull is performed via a cronjob or a script.

Following this mail is a patch that tries to address the problem by not updating the ORIG_HEAD ref when it detects an empty merge (i.e. local is in sync with the remote). That way, one can still do diffstat/log between ORIG_HEAD..HEAD.

It's still possible to revert to old behavior with: o. --force-update-orig-head cmd line option o. merge.forceupdateorighead config option

Please review the patch and let me know if: a) it makes sense to have this functionality b) if the patch looks OK

Please let me know if there are any changes required. I'll write the test cases and send them in another mail later.

Thanks, Kunal

Kunal Gangakhedkar (1):
  merge: Preserve ORIG_HEAD if already up-to-date with remote.
 builtin/merge.c |   26 ++++++++++++++++++++++++--
 1 files changed, 24 insertions(+), 2 deletions(-)
-- 
1.7.6.rc1.2.g20c4a.dirty
Next: Kunal Gangakhedkar
Message 1 of 4 in “Preserve ORIG_HEAD if already up-to-date with remote.”
  1. Preserve ORIG_HEAD if already up-to-date with remote.Kunal Gangakhedkar, Jun 13, 2011
  2. merge: Preserve ORIG_HEAD if already up-to-date with remote.Kunal Gangakhedkar, Jun 13, 2011
  3. Junio C HamanoJun 14, 2011
  4. Kunal GangakhedkarJul 17, 2011

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.