Re: [Wikitech-l] Moving a GitHub Pull Request to Gerrit Changeset manually

2013-05-22 Thread Yuvi Panda
Bump! This is now fully automatic! Enabled for the following repos:

qa/browsertests
extensions/PostEdit
extensions/GuidedTour
extensions/GettingStarted
extensions/EventLogging
extensions/MobileFrontend

(I've asked the people who are major contributors to the repos and
gotten agreement to turn it on)

So everytime a pull request is opened on GitHub for their respective
repositories, a Gerrit Changeset will appear in about 4-5 seconds.
Updating the Pull Request will also update the Gerrit Changeset.
Comment Syncing coming soon.

Code is at https://github.com/yuvipanda/SuchABot. It runs on Tools
Labs. More detailed description at
https://www.mediawiki.org/wiki/User:Yuvipanda/G2G

With a little bit more experimentation, perhaps we can figure out a
nice workflow, while keeping Gerrit our 'Canonical' Repository.

Thanks to everyone who helped!

--
Yuvi Panda T
http://yuvi.in/blog

___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Re: [Wikitech-l] Moving a GitHub Pull Request to Gerrit Changeset manually

2013-05-22 Thread Steven Walling
On Wednesday, May 22, 2013, Yuvi Panda wrote:

 Bump! This is now fully automatic! Enabled for the following repos:

 qa/browsertests
 extensions/PostEdit
 extensions/GuidedTour
 extensions/GettingStarted
 extensions/EventLogging
 extensions/MobileFrontend

 (I've asked the people who are major contributors to the repos and
 gotten agreement to turn it on)

 So everytime a pull request is opened on GitHub for their respective
 repositories, a Gerrit Changeset will appear in about 4-5 seconds.
 Updating the Pull Request will also update the Gerrit Changeset.
 Comment Syncing coming soon.

 Code is at https://github.com/yuvipanda/SuchABot. It runs on Tools
 Labs. More detailed description at
 https://www.mediawiki.org/wiki/User:Yuvipanda/G2G

 With a little bit more experimentation, perhaps we can figure out a
 nice workflow, while keeping Gerrit our 'Canonical' Repository.

 Thanks to everyone who helped!


I volunteered to be a guinea pig for this, with a pull request to
GuidedTour. I'm a good proxy for a newbie since I've never actually
committed new code to Gerrit, even though I review/comment pretty often.

Steven




 --
 Yuvi Panda T
 http://yuvi.in/blog

 ___
 Wikitech-l mailing list
 Wikitech-l@lists.wikimedia.org javascript:;
 https://lists.wikimedia.org/mailman/listinfo/wikitech-l
___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Re: [Wikitech-l] Moving a GitHub Pull Request to Gerrit Changeset manually

2013-05-22 Thread Tyler Romeo
 def log(s):
print s

:D

Seriously, though, this is pretty awesome. Also good to see the sh module
getting some use.

*-- *
*Tyler Romeo*
Stevens Institute of Technology, Class of 2015
Major in Computer Science
www.whizkidztech.com | tylerro...@gmail.com


On Wed, May 22, 2013 at 4:45 PM, Steven Walling steven.wall...@gmail.comwrote:

 On Wednesday, May 22, 2013, Yuvi Panda wrote:

  Bump! This is now fully automatic! Enabled for the following repos:
 
  qa/browsertests
  extensions/PostEdit
  extensions/GuidedTour
  extensions/GettingStarted
  extensions/EventLogging
  extensions/MobileFrontend
 
  (I've asked the people who are major contributors to the repos and
  gotten agreement to turn it on)
 
  So everytime a pull request is opened on GitHub for their respective
  repositories, a Gerrit Changeset will appear in about 4-5 seconds.
  Updating the Pull Request will also update the Gerrit Changeset.
  Comment Syncing coming soon.
 
  Code is at https://github.com/yuvipanda/SuchABot. It runs on Tools
  Labs. More detailed description at
  https://www.mediawiki.org/wiki/User:Yuvipanda/G2G
 
  With a little bit more experimentation, perhaps we can figure out a
  nice workflow, while keeping Gerrit our 'Canonical' Repository.
 
  Thanks to everyone who helped!


 I volunteered to be a guinea pig for this, with a pull request to
 GuidedTour. I'm a good proxy for a newbie since I've never actually
 committed new code to Gerrit, even though I review/comment pretty often.

 Steven



 
  --
  Yuvi Panda T
  http://yuvi.in/blog
 
  ___
  Wikitech-l mailing list
  Wikitech-l@lists.wikimedia.org javascript:;
  https://lists.wikimedia.org/mailman/listinfo/wikitech-l
 ___
 Wikitech-l mailing list
 Wikitech-l@lists.wikimedia.org
 https://lists.wikimedia.org/mailman/listinfo/wikitech-l

___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Re: [Wikitech-l] Moving a GitHub Pull Request to Gerrit Changeset manually

2013-05-22 Thread Yuvi Panda
On Thu, May 23, 2013 at 3:17 AM, Tyler Romeo tylerro...@gmail.com wrote:
 def log(s):
print s
 :D

The entire codebase could use some cleanup :) Also I had replaced the
prints with appropriate logging sometime in the past, but changed it
back because lazyness.

 Seriously, though, this is pretty awesome. Also good to see the sh module
 getting some use.

Oh yes, sh is awesome!


--
Yuvi Panda T
http://yuvi.in/blog

___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Re: [Wikitech-l] Moving a GitHub Pull Request to Gerrit Changeset manually

2013-03-26 Thread Platonides
This should work:

WIKIMEDIA_REPOS=/path/where/you/have/your/clones
REPO=$1 # qa/browsertests
PULL=$2 # https://github.com/brainwane/qa-browsertests.git

TEMP=`mktemp --tmpdir -d pull-request.XXX`
git clone --reference=$WIKIMEDIA_REPOS/$REPO  $PULL $TEMP
cd $TEMP

if [ ! -f .gitreview ]; then
cat  .gitreview EOF
[gerrit]
host=gerrit.wikimedia.org
port=29418
project=$REPO.git
defaultbranch=master
defaultrebase=0
EOF
fi

git-review -R

rm -rf $TEMP


___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Re: [Wikitech-l] Moving a GitHub Pull Request to Gerrit Changeset manually

2013-03-25 Thread Yuvi Panda
On Tue, Mar 19, 2013 at 3:53 AM, Matthew Flaschen
mflasc...@wikimedia.org wrote:
 Also, force-removing the rebase-apply directory is worrisome.  I think
 most or all of the rebase commands have --abort options.  If a rebase is
 in progress, can you exit and prompt the user to finish or abort, rather
 than blowing it apply?

Good point. I was just locally testing on an uninteresting (to me)
repo, so that was fine. Will keep in mind while writing the 'proper'
script.

--
Yuvi Panda T
http://yuvi.in/blog

___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Re: [Wikitech-l] Moving a GitHub Pull Request to Gerrit Changeset manually

2013-03-18 Thread Željko Filipin
On Sat, Mar 16, 2013 at 1:11 AM, Yuvi Panda yuvipa...@gmail.com wrote:

 So I tried converting
 https://github.com/wikimedia/qa-browsertests/pull/1 into a Gerrit
 changeset
 (https://gerrit.wikimedia.org/r/#/c/54097/) , and was mostly successful.


Thanks. :)

Željko
___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Re: [Wikitech-l] Moving a GitHub Pull Request to Gerrit Changeset manually

2013-03-18 Thread Tyler Romeo
Couldn't you also just fetch the pull request, rebase it on master with the
-i flag, and set the commits to squash?

*--*
*Tyler Romeo*
Stevens Institute of Technology, Class of 2015
Major in Computer Science
www.whizkidztech.com | tylerro...@gmail.com


On Mon, Mar 18, 2013 at 2:22 PM, Željko Filipin zfili...@wikimedia.orgwrote:

 On Sat, Mar 16, 2013 at 1:11 AM, Yuvi Panda yuvipa...@gmail.com wrote:

  So I tried converting
  https://github.com/wikimedia/qa-browsertests/pull/1 into a Gerrit
  changeset
  (https://gerrit.wikimedia.org/r/#/c/54097/) , and was mostly successful.
 

 Thanks. :)

 Željko
 ___
 Wikitech-l mailing list
 Wikitech-l@lists.wikimedia.org
 https://lists.wikimedia.org/mailman/listinfo/wikitech-l

___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Re: [Wikitech-l] Moving a GitHub Pull Request to Gerrit Changeset manually

2013-03-18 Thread Yuvi Panda
On Tue, Mar 19, 2013 at 12:37 AM, Tyler Romeo tylerro...@gmail.com wrote:

 Couldn't you also just fetch the pull request, rebase it on master with
 the -i flag, and set the commits to squash?


That is what I first did. Too manual for my tastes :) In this case I only
have to deal with one edit operation (for the commit message), rather than
a s/pick/s/ for rebase -i.

This was a first cut from about 5 mins of work - I'm sure it could be
improved in many many ways
-- 
Yuvi Panda T
http://yuvi.in/blog
___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Re: [Wikitech-l] Moving a GitHub Pull Request to Gerrit Changeset manually

2013-03-18 Thread Tyler Romeo
On Mon, Mar 18, 2013 at 3:10 PM, Yuvi Panda yuvipa...@gmail.com wrote:

 That is what I first did. Too manual for my tastes :) In this case I only
 have to deal with one edit operation (for the commit message), rather than
 a s/pick/s/ for rebase -i.

 This was a first cut from about 5 mins of work - I'm sure it could be
 improved in many many ways


:P Good point.

*--*
*Tyler Romeo*
Stevens Institute of Technology, Class of 2015
Major in Computer Science
www.whizkidztech.com | tylerro...@gmail.com
___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Re: [Wikitech-l] Moving a GitHub Pull Request to Gerrit Changeset manually

2013-03-18 Thread Matthew Flaschen
On 03/15/2013 08:11 PM, Yuvi Panda wrote:
 Hello! So I tried converting
 https://github.com/wikimedia/qa-browsertests/pull/1 into a Gerrit changeset
 (https://gerrit.wikimedia.org/r/#/c/54097/) , and was mostly successful. It
 is also a relatively painless process - at least for single commits.

This is really good to see.

 Note that this is a shitty bash script (to put it mildly) - but that seems
 to be all I can write at 5:30 AM :) I'll probably rewrite it to be a proper
 python one soon. That should also allow me to use the GitHub API to also
 mirror the GitHub Pull Request Title / Description to Gerrit.

Also, force-removing the rebase-apply directory is worrisome.  I think
most or all of the rebase commands have --abort options.  If a rebase is
in progress, can you exit and prompt the user to finish or abort, rather
than blowing it apply?

Matt Flaschen

___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Re: [Wikitech-l] Moving a GitHub Pull Request to Gerrit Changeset manually

2013-03-18 Thread Tim Landscheidt
Matthew Flaschen mflasc...@wikimedia.org wrote:

 [...]

 Note that this is a shitty bash script (to put it mildly) - but that seems
 to be all I can write at 5:30 AM :) I'll probably rewrite it to be a proper
 python one soon. That should also allow me to use the GitHub API to also
 mirror the GitHub Pull Request Title / Description to Gerrit.

 Also, force-removing the rebase-apply directory is worrisome.  I think
 most or all of the rebase commands have --abort options.  If a rebase is
 in progress, can you exit and prompt the user to finish or abort, rather
 than blowing it apply?

The nice thing about Git is that you can create new
workspaces at little cost -- git clone --reference
$LOCALREPO $GERRITURL $TEMPDIR (or git clone $LOCALREPO
$TEMPDIR if $LOCALREPO is up-to-date) will give you a clean
checkout in $TEMPDIR, where you can then easily run all
kinds of rebases, squashes and whatnot, and when you either
have pushed the resulting commit to Gerrit or aborted be-
cause you ran into some problems, you can just remove the
whole directory.  No need to worry about the state of your
working copy or how you might mess up your branches, stashes
 Co.

Tim


___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l