From: Max Kirillov <max@max630.net>
To: git@vger.kernel.org
Subject: [ANNOUNCE] git-push-update, tool to push with "server-side" merge or rebase
Date: Mon, 28 Mar 2016 11:08:41 +0300 [thread overview]
Message-ID: <20160328080841.GA12932@wheezy.local> (raw)
Hello.
I would like to announce git-push-update, a tool which emulates
server-side merge or rebase.
The link: https://github.com/max630/git-push-update
It is a bash script which fetches latest remote branch, creates
temporary clone, performs there merge or rebase, pushes results to
server. If during the merge or rebase remote branch was updated, it
fails cleanly, so you are not left with merge which did not go anywhere.
Or it can even retry the whole task from the beginning, until it
eventually succeeds.
I tried to make it easy to use by unexperienced users by making as few
options as possible and checking for some dangerous mistakes. It would
be nice if somebody tried to really use it, so there would be some data
does this direction worth exploring. Any other feedback is also welcome.
A longer explanation:
While topic branches/pullrequests/whatever-it-named workflow is
obviously superior to push-to-trunk approach which is used with
centralized VCSes, there can be cases to use the latter one. But doing
it with Git is not easy:
* when the trunk goes forward, user have to run merge or
rebase (further "update"), interrupting other work which
might be in progress.
* while doing fetch, update and push back a concurrent push can happen,
making user to have to repeat it all over.
* some scenarios allow user to make a mistake combining branches which
mean to be unrelated, for example merging or rebasing active
development branch into maintenance branch for older version.
* for a merge case there is a problem of "evil pull"
(http://thread.gmane.org/gmane.comp.version-control.git/247237)
In short: the merges which are to go to remote branch should be "from
local to remote", and git-pull merges "from remote to local".
This was discussed around some time ago, but I could not find anything
done about it. It might seem like nobody really interested much. But I
still can see discussions here and there. Also, some time ago extension
"pushrebase" for mercurial appeared, which indicates that there is
really a demand.
Looks like current git remote protocol does not really allow server to
tweak pushed commits: if it accepts reference, client will remember
exactly the commit it was pushing, no modifications is possible. Also,
if it is implemented as server-side feature, it might take years to
appear at github or other big public hostings, if ever. Until that most
users would not be able to try it.
This leaves only one option: perform merge or rebase locally, pretending
that it was done at server. It does not even have to be implemented in
git itself, instead a wrapper script can do everything.
So here is the script.
--
Max
next reply other threads:[~2016-03-28 8:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-28 8:08 Max Kirillov [this message]
2016-03-30 1:29 ` [ANNOUNCE] git-push-update, tool to push with "server-side" merge or rebase Trevor Saunders
2016-03-30 4:55 ` Max Kirillov
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=20160328080841.GA12932@wheezy.local \
--to=max@max630.net \
--cc=git@vger.kernel.org \
/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).