git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kunal Gangakhedkar <kunal.gangakhedkar@gmail.com>
To: gitster@pobox.com
Cc: git@vger.kernel.org, Kunal Gangakhedkar <kunal.gangakhedkar@gmail.com>
Subject: [PATCH] Preserve ORIG_HEAD if already up-to-date with remote.
Date: Mon, 13 Jun 2011 13:05:24 +0530	[thread overview]
Message-ID: <1307950525-8011-1-git-send-email-kunal.gangakhedkar@gmail.com> (raw)

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

             reply	other threads:[~2011-06-13  7:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-13  7:35 Kunal Gangakhedkar [this message]
2011-06-13  7:35 ` [PATCH] merge: Preserve ORIG_HEAD if already up-to-date with remote Kunal Gangakhedkar
2011-06-14 23:14   ` Junio C Hamano
2011-07-17 16:31     ` Kunal Gangakhedkar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1307950525-8011-1-git-send-email-kunal.gangakhedkar@gmail.com \
    --to=kunal.gangakhedkar@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).