[opensuse-buildservice] [PATCH] checkout git branch with tar_scm source servce
The following patch enables tar_scm to checkout a specified git branch instead of HEAD. For svn, the option is meaningless as the branch is part of the URL. I don't know anything about Hg, so can't say if the option is used there. For now I have marked it (git only). Any comments? Where is tar_scm's source repo so I can submit it there? Will -- Will Stephenson, openSUSE Team SUSE LINUX Products GmbH - Nürnberg - AG Nürnberg - HRB 16746 - GF: Markus Rex -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
On Saturday 09 April 2011 15:46:58 Will Stephenson wrote:
The following patch enables tar_scm to checkout a specified git branch instead of HEAD.
For svn, the option is meaningless as the branch is part of the URL. I don't know anything about Hg, so can't say if the option is used there. For now I have marked it (git only).
Any comments? No diff attached?
Where is tar_scm's source repo so I can submit it there? Adrian? -- Mit freundlichen Grüßen, Sascha Peilicke http://saschpe.wordpress.com
Am Montag, 11. April 2011, 08:44:30 schrieb Sascha Peilicke:
On Saturday 09 April 2011 15:46:58 Will Stephenson wrote:
The following patch enables tar_scm to checkout a specified git branch instead of HEAD.
For svn, the option is meaningless as the branch is part of the URL. I don't know anything about Hg, so can't say if the option is used there. For now I have marked it (git only).
Any comments? No diff attached?
Where is tar_scm's source repo so I can submit it there? Adrian?
osc bco openSUSE:Tools obs-service-tar_scm -- Adrian Schroeter SUSE Linux Products GmbH email: adrian@suse.de -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
On Monday 11 April 2011 09:38:37 Adrian Schröter wrote:
Am Montag, 11. April 2011, 08:44:30 schrieb Sascha Peilicke:
On Saturday 09 April 2011 15:46:58 Will Stephenson wrote:
The following patch enables tar_scm to checkout a specified git branch instead of HEAD.
For svn, the option is meaningless as the branch is part of the URL. I don't know anything about Hg, so can't say if the option is used there. For now I have marked it (git only).
Any comments?
No diff attached?
Where is tar_scm's source repo so I can submit it there?
Adrian?
osc bco openSUSE:Tools obs-service-tar_scm
Which means currently, we're publishing the source service code only via packages. But we may want to have 'em on gitorious, too. -- Mit freundlichen Grüßen, Sascha Peilicke http://saschpe.wordpress.com
Am Montag, 11. April 2011, 09:54:46 schrieb Sascha Peilicke:
On Monday 11 April 2011 09:38:37 Adrian Schröter wrote:
Am Montag, 11. April 2011, 08:44:30 schrieb Sascha Peilicke:
On Saturday 09 April 2011 15:46:58 Will Stephenson wrote:
The following patch enables tar_scm to checkout a specified git branch instead of HEAD.
For svn, the option is meaningless as the branch is part of the URL. I don't know anything about Hg, so can't say if the option is used there. For now I have marked it (git only).
Any comments?
No diff attached?
Where is tar_scm's source repo so I can submit it there?
Adrian?
osc bco openSUSE:Tools obs-service-tar_scm
Which means currently, we're publishing the source service code only via packages. But we may want to have 'em on gitorious, too.
Since it is just a single file, it was an unnecessary burden to me so far. It works so far with a single osc command (commit or "rq accept"), via gitorious I would need to * See git merge request (usually I don't in time due to lack of notifications * git checkout merg... * git pull merge... * git pull --rebase * git push * go to the web interface, search it and mark it as merged * tar the directory * osc commit Looks highly un-efficient to me for all these small packages and due to the lack of merge request notifications the turn around times will also increase a lot. -- Adrian Schroeter SUSE Linux Products GmbH email: adrian@suse.de -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
On Monday 11 April 2011 10:05:20 Adrian Schröter wrote:
* See git merge request (usually I don't in time due to lack of notifications * git checkout merg... * git pull merge... * git pull --rebase * git push * go to the web interface, search it and mark it as merged * tar the directory * osc commit
Looks highly un-efficient to me for all these small packages [...]
A slap in the faces of all maintainers of small packages. Thanks. So lets rather make it easier to use instead of circumventing it. Ciao, Daniel -- J. Daniel Schmidt <jdsn@suse.de> SUSE Linux Products GmbH Research & Development Maxfeldstr. 5 GF: Markus Rex, HRB 16746 (AG Nürnberg) D-90409 Nürnberg -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
Am Dienstag, 12. April 2011, 15:38:58 schrieb J. Daniel Schmidt:
On Monday 11 April 2011 10:05:20 Adrian Schröter wrote:
* See git merge request (usually I don't in time due to lack of notifications * git checkout merg... * git pull merge... * git pull --rebase * git push * go to the web interface, search it and mark it as merged * tar the directory * osc commit
Looks highly un-efficient to me for all these small packages [...]
A slap in the faces of all maintainers of small packages. Thanks.
So lets rather make it easier to use instead of circumventing it.
Feel free to discuss that with git / gitorious authors. -- Adrian Schroeter SUSE Linux Products GmbH email: adrian@suse.de -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
On Tuesday 12 April 2011 15:57:13 Adrian Schröter wrote:
* See git merge request (usually I don't in time due to lack of notifications * git checkout merg... * git pull merge... * git pull --rebase * git push * go to the web interface, search it and mark it as merged * tar the directory * osc commit
Looks highly un-efficient to me for all these small packages [...]
A slap in the faces of all maintainers of small packages. Thanks.
So lets rather make it easier to use instead of circumventing it.
Feel free to discuss that with git / gitorious authors.
Sorry, but this is is no way a git/gitorious specific problem. YaST for example is still in SVN and we also have to do several steps until we can do an "osc commit". Just one quick idea: We could create a OBS plugi n that automatically pushes the changes to the files of a package (not every package, only marked ones) into an auto-generated git repo $somewhere. Then you can continue working like before and the current code is in a git repo outside on a non-OBS server. Ciao, Daniel -- J. Daniel Schmidt <jdsn@suse.de> SUSE Linux Products GmbH Research & Development Maxfeldstr. 5 GF: Markus Rex, HRB 16746 (AG Nürnberg) D-90409 Nürnberg -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
Am Dienstag, 12. April 2011, 16:23:34 schrieb J. Daniel Schmidt:
On Tuesday 12 April 2011 15:57:13 Adrian Schröter wrote:
* See git merge request (usually I don't in time due to lack of notifications * git checkout merg... * git pull merge... * git pull --rebase * git push * go to the web interface, search it and mark it as merged * tar the directory * osc commit
Looks highly un-efficient to me for all these small packages [...]
A slap in the faces of all maintainers of small packages. Thanks.
So lets rather make it easier to use instead of circumventing it.
Feel free to discuss that with git / gitorious authors.
Sorry, but this is is no way a git/gitorious specific problem.
YaST for example is still in SVN and we also have to do several steps until we can do an "osc commit".
Just one quick idea: We could create a OBS plugi n that automatically pushes the changes to the files of a package (not every package, only marked ones) into an auto-generated git repo $somewhere. Then you can continue working like before and the current code is in a git repo outside on a non-OBS server.
And how would that help on merge stuff back ? It would just overwrite stuff which comes via a different route ? Can you name a single advantage when using git for such a single file project ? -- Adrian Schroeter SUSE Linux Products GmbH email: adrian@suse.de -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
On Tuesday 12 April 2011 16:54:40 Adrian Schröter wrote:
Just one quick idea: [...]
And how would that help on merge stuff back ? It would just overwrite stuff which comes via a different route ?
Only if it is designed in a way that it overwrites stuff. Just like to put problems here to try to end the discussion or really interested and an answer? :) Here is one anyhow: Git has branches, so let this plugin push to a dedicated git branch eg. "OBS-controlled" and nobody will bother you when it overwrites stuff - its just a copy of what is in OBS.
Can you name a single advantage when using git for such a single file project ?
I didn't say you should use a git repo for a single file. So here is the single advantage you asked for: 1. The code is not only in OBS but also at a second place out in the public. This was Saschas only concern. To solve it, just put the one file anywhere else in the public. As the maintainance overhead seemed to be a problem I wanted to encourage to find a different solution than just circumventing it. Ciao, Daniel -- J. Daniel Schmidt <jdsn@suse.de> SUSE Linux Products GmbH Research & Development Maxfeldstr. 5 GF: Markus Rex, HRB 16746 (AG Nürnberg) D-90409 Nürnberg -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
Adrian Schröter wrote:
Am Montag, 11. April 2011, 09:54:46 schrieb Sascha Peilicke:
Which means currently, we're publishing the source service code only via packages. But we may want to have 'em on gitorious, too.
Since it is just a single file, it was an unnecessary burden to me so far.
It works so far with a single osc command (commit or "rq accept"), via gitorious I would need to
* See git merge request (usually I don't in time due to lack of notifications * git checkout merg... * git pull merge... * git pull --rebase * git push * go to the web interface, search it and mark it as merged * tar the directory * osc commit
Looks highly un-efficient to me for all these small packages and due to the lack of merge request notifications the turn around times will also increase a lot.
Only as long as you don't have local changes and no conflicting requests. You can disable gitorious merge requests if you don't like them btw. People will simply use git send-email then. cu Ludwig -- (o_ Ludwig Nussel //\ V_/_ http://www.suse.de/ SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg) -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
On Monday 11 April 2011 08:44:30 Sascha Peilicke wrote:
On Saturday 09 April 2011 15:46:58 Will Stephenson wrote:
The following patch enables tar_scm to checkout a specified git branch instead of HEAD.
For svn, the option is meaningless as the branch is part of the URL. I don't know anything about Hg, so can't say if the option is used there. For now I have marked it (git only).
Any comments?
No diff attached?
Whoops - guess I should add 'patch' to the strings that trigger an attachment warning from kmail. Will -- Will Stephenson, KDE Developer, openSUSE Boosters Team SUSE LINUX Products GmbH - Nürnberg - AG Nürnberg - HRB 16746 - GF: Markus Rex
Am Montag, 11. April 2011, 12:28:42 schrieb Will Stephenson:
On Monday 11 April 2011 08:44:30 Sascha Peilicke wrote:
On Saturday 09 April 2011 15:46:58 Will Stephenson wrote:
The following patch enables tar_scm to checkout a specified git branch instead of HEAD.
For svn, the option is meaningless as the branch is part of the URL. I don't know anything about Hg, so can't say if the option is used there. For now I have marked it (git only).
Any comments?
No diff attached?
Whoops - guess I should add 'patch' to the strings that trigger an attachment warning from kmail.
Hm, but why do you need this at all ? Isn't git checkout -r $BRANCH working for you ? -- Adrian Schroeter SUSE Linux Products GmbH email: adrian@suse.de -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
On Monday 11 April 2011 13:16:25 Adrian Schröter wrote:
Hm, but why do you need this at all ? ^^^^ I'm not sure what 'this' refers to, did you mean this line:
+ git checkout -B "$MYBRANCH"
Isn't
git checkout -r $BRANCH
working for you ?
? Did I miss a git syntax trick? the git-checkout manpage doesn't mention an -r option. My intention is to have a source service that can tar up an arbitrary branch, and afaics there isn't a way to do that with git in tar_scm at present. If I understand correctly, tar_scm may be called where an existing clone exists, so I used checkout -B to cover the case that the user changes the branch in an existing source service so the existing clone is checked out to the requested branch. Will -- Will Stephenson, KDE Developer, openSUSE Boosters Team SUSE LINUX Products GmbH - Nürnberg - AG Nürnberg - HRB 16746 - GF: Markus Rex -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
On Mon, Apr 11, 2011 at 02:31:02PM +0200, Will Stephenson wrote:
On Monday 11 April 2011 13:16:25 Adrian Schröter wrote:
Hm, but why do you need this at all ? ^^^^ I'm not sure what 'this' refers to, did you mean this line:
+ git checkout -B "$MYBRANCH"
Isn't
git checkout -r $BRANCH
working for you ?
? Did I miss a git syntax trick? the git-checkout manpage doesn't mention an -r option.
My intention is to have a source service that can tar up an arbitrary branch, and afaics there isn't a way to do that with git in tar_scm at present. If I understand correctly, tar_scm may be called where an existing clone exists, so I used checkout -B to cover the case that the user changes the branch in an existing source service so the existing clone is checked out to the requested branch.
Errm, just use git archive <tag or branchname> e.g. I use for Wine: git archive origin --prefix=wine-$winever.$xdate/ | bzip2 >$bsdir/wine-$winever.$xdate.tar.bz2 Of your you can replace "origin" by whatever branch or tag or other GIT thingie you want. Ciao, Marcus -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
On Monday 11 April 2011 14:33:47 Marcus Meissner wrote:
On Mon, Apr 11, 2011 at 02:31:02PM +0200, Will Stephenson wrote:
On Monday 11 April 2011 13:16:25 Adrian Schröter wrote:
Hm, but why do you need this at all ?
^^^^
I'm not sure what 'this' refers to, did you mean this line:
+ git checkout -B "$MYBRANCH"
Isn't
git checkout -r $BRANCH
working for you ?
? Did I miss a git syntax trick? the git-checkout manpage doesn't mention an -r option.
My intention is to have a source service that can tar up an arbitrary branch, and afaics there isn't a way to do that with git in tar_scm at present. If I understand correctly, tar_scm may be called where an existing clone exists, so I used checkout -B to cover the case that the user changes the branch in an existing source service so the existing clone is checked out to the requested branch.
Errm, just use
git archive <tag or branchname>
e.g. I use for Wine:
git archive origin --prefix=wine-$winever.$xdate/ | bzip2
$bsdir/wine-$winever.$xdate.tar.bz2
Of your you can replace "origin" by whatever branch or tag or other GIT thingie you want.
This is how I understand the existing algorithm, augmented (+) by my patch: if (tarball exists) extract it update it + ensure requested git branch is checked out else clone + requested branch endif tar up the result. git archive doesn't include the .git dir so it wouldn't be updateable. Will -- Will Stephenson, KDE Developer, openSUSE Boosters Team SUSE LINUX Products GmbH - Nürnberg - AG Nürnberg - HRB 16746 - GF: Markus Rex -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
Am Montag, 11. April 2011, 14:31:02 schrieb Will Stephenson:
On Monday 11 April 2011 13:16:25 Adrian Schröter wrote:
Hm, but why do you need this at all ? ^^^^ I'm not sure what 'this' refers to, did you mean this line:
+ git checkout -B "$MYBRANCH"
Isn't
git checkout -r $BRANCH
working for you ?
? Did I miss a git syntax trick? the git-checkout manpage doesn't mention an -r option.
right, it is just "git checkout $BRANCH". Why do you need the -B option and therefore an extra switch ?
My intention is to have a source service that can tar up an arbitrary branch, and afaics there isn't a way to do that with git in tar_scm at present. If I understand correctly, tar_scm may be called where an existing clone exists, so I used checkout -B to cover the case that the user changes the branch in an existing source service so the existing clone is checked out to the requested branch.
-B is creating a new branch. An existing tar ball may be used to reduce the needed deltas to download. But this is complete independend of a checkout.
Will -- Will Stephenson, KDE Developer, openSUSE Boosters Team SUSE LINUX Products GmbH - Nürnberg - AG Nürnberg - HRB 16746 - GF: Markus Rex
-- Adrian Schroeter SUSE Linux Products GmbH email: adrian@suse.de -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
On Monday 11 April 2011 14:34:14 Adrian Schröter wrote:
Am Montag, 11. April 2011, 14:31:02 schrieb Will Stephenson:
On Monday 11 April 2011 13:16:25 Adrian Schröter wrote:
Hm, but why do you need this at all ?
^^^^
I'm not sure what 'this' refers to, did you mean this line:
+ git checkout -B "$MYBRANCH"
Isn't
git checkout -r $BRANCH
working for you ?
? Did I miss a git syntax trick? the git-checkout manpage doesn't mention an -r option.
right, it is just "git checkout $BRANCH".
Why do you need the -B option and therefore an extra switch ?
Because I only speak baby git and didn't realise that no extra flags are necessary if the remote branch exists :/ So the patch is redundant because --revision can be used to checkout a particular branch, correct? Will -- Will Stephenson, KDE Developer, openSUSE Boosters Team SUSE LINUX Products GmbH - Nürnberg - AG Nürnberg - HRB 16746 - GF: Markus Rex -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
Am Montag, 11. April 2011, 15:05:48 schrieb Will Stephenson:
On Monday 11 April 2011 14:34:14 Adrian Schröter wrote:
Am Montag, 11. April 2011, 14:31:02 schrieb Will Stephenson:
On Monday 11 April 2011 13:16:25 Adrian Schröter wrote:
Hm, but why do you need this at all ?
^^^^
I'm not sure what 'this' refers to, did you mean this line:
+ git checkout -B "$MYBRANCH"
Isn't
git checkout -r $BRANCH
working for you ?
? Did I miss a git syntax trick? the git-checkout manpage doesn't mention an -r option.
right, it is just "git checkout $BRANCH".
Why do you need the -B option and therefore an extra switch ?
Because I only speak baby git and didn't realise that no extra flags are necessary if the remote branch exists :/
So the patch is redundant because --revision can be used to checkout a particular branch, correct?
I think so. -- Adrian Schroeter SUSE Linux Products GmbH email: adrian@suse.de -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
participants (6)
-
Adrian Schröter
-
J. Daniel Schmidt
-
Ludwig Nussel
-
Marcus Meissner
-
Sascha Peilicke
-
Will Stephenson