From: Maximilian Mehnert <maximilian.mehnert@googlemail.com>
To: git@vger.kernel.org
Subject: suggestion? only pull cleanly applying commits
Date: Wed, 26 Nov 2008 12:48:50 +0100 [thread overview]
Message-ID: <492D37A2.4010500@googlemail.com> (raw)
Hi!
I've a scenario where I don't really want to do a full merge but rather
to pull all commits from another repository that merge without conflicts.
I've put together the script at the bottom which seems to work ok but is
damn slow.
Is there a smarter and faster way to do this that I missed reading the
documentation?
Any help would be really appreciated! :-)
Regards,
Maximilian
#!/bin/sh
for commit in `git rev-list --reverse HEAD..other-repository/master`; do
git diff-tree -p $commit|patch --dry-run -p1 -N -f >/dev/null
if [ $? -eq 0 ]; then
echo "getting $commit"
parents=`git rev-list --parents -n1 $commit|wc -w`
if [ $parents -eq 2 ]; then
git cherry-pick $commit
else
git cherry-pick -m1 $commit
fi
fi
done
next reply other threads:[~2008-11-26 11:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-26 11:48 Maximilian Mehnert [this message]
2008-11-26 13:30 ` suggestion? only pull cleanly applying commits Andreas Ericsson
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=492D37A2.4010500@googlemail.com \
--to=maximilian.mehnert@googlemail.com \
--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).