git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Preserve ORIG_HEAD if already up-to-date with remote.
@ 2011-06-13  7:35 Kunal Gangakhedkar
  2011-06-13  7:35 ` [PATCH] merge: " Kunal Gangakhedkar
  0 siblings, 1 reply; 4+ messages in thread
From: Kunal Gangakhedkar @ 2011-06-13  7:35 UTC (permalink / raw)
  To: gitster; +Cc: git, Kunal Gangakhedkar

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-07-17 16:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-13  7:35 [PATCH] Preserve ORIG_HEAD if already up-to-date with remote Kunal Gangakhedkar
2011-06-13  7:35 ` [PATCH] merge: " Kunal Gangakhedkar
2011-06-14 23:14   ` Junio C Hamano
2011-07-17 16:31     ` Kunal Gangakhedkar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).