Re: I want "fast forward my workdir to upstream if it's safe"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 8. mai. 2009, at 04.30, Jeff King wrote:

On Thu, May 07, 2009 at 02:40:00PM -0700, Randal L. Schwartz wrote:

So, what I need is a command, likely an option to "git merge" that says "do everything that a git merge would do except abort if it would have been a merge commit". In other words, abort if the workdir is dirty or is not a
fast-forward update to the upstream.  Bonus if it exits non-zero if
something went wrong.

Can you define more clearly what you want, because you are asking for
conflicting things. "abort if it would have been a merge commit" is
purely about fast forward. But it sounds like you also care about "would
merge have succeeded". So I think you are asking for:

 1. There are no local commits on the branch.

and one of:

 2a. There are no local edits.

 2b. There are no local edits in the same files as those that are
     affected by any new commits from upstream.

2c. Any local edits you have done would not cause a conflict if merged
     with what's in upstream.

I read it as a request for pull/merge --ff-only (based on "abort if the workdir is dirty or is not a fast-forward update"). This feature has been implemented twice, but never included:

http://article.gmane.org/gmane.comp.version-control.git/76787
http://article.gmane.org/gmane.comp.version-control.git/107768
http://article.gmane.org/gmane.comp.version-control.git/80284
--
Eyvind Bernhardsen

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]