[ http://jira.codehaus.org/browse/SCM-444?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=189809#action_189809 ]
Mark Struberg commented on SCM-444: ----------------------------------- Petter, pushing to the current branch should already be the default behaviour. We also had a discussion about whether we should add more support for distributed SCMs in maven-scm-api in the future, because bazaar, hg, etc works the same way basically. There are 2 issues: * The current way of always pushing is good for projects like we have here at Apache and a few other pretty centralised projects where basically only 1 main repository exists. But it the project is more a forked pull-it-from-wherever-you-need approach, this probably wont work for the long term. Another idea is that it would make testing releases a lot easier. You do a 'local' release and push it to a staging repo. If all works out fine then you can push the tag to the central repo... * For release:perform we currently do a git-clone from the upstream repo. This may cause some unnecessary traffic (and time). This is not such a big problem for git but for hg and bazaar which performs a lot slower. Since with all DCMS we have the full repo available locally, we may easily checkout into target/checkout from our _local_ repo instead of going to the remote. > Git provider does 'git push' during 'mvn release:prepare' which causes > unwanted problems > ---------------------------------------------------------------------------------------- > > Key: SCM-444 > URL: http://jira.codehaus.org/browse/SCM-444 > Project: Maven SCM > Issue Type: Bug > Components: maven-scm-provider-git > Affects Versions: 1.1 > Reporter: Petter Måhlén > Priority: Minor > > When doing 'mvn release:prepare' with a Git provider, a 'git push' command is > executed. This is not ideal because the push command can fail or push things > from the local repository that are not needed/wanted in the remote > repository. Some examples are: > 1. The local repository has two branches: master (tracking origin/master) and > dummy (tracking origin/dummy). The release is being made on the master > branch, and the dummy and origin/dummy branches have diverged. Running > 'release:prepare' causes a 'git push', which will succeed for the master > branch (assuming that the release preparation has been made correctly) and > fail for the dummy branch (the two branches have diverged and need to be > merged or rebased). The release preparation aborts and the directory is left > in a somewhat inconsistent state where manual cleaning up is needed (removing > pom.xml.next files, changing versions to <new>-SNAPSHOT, etc.) > 2. The local repository has two branches: master (tracking origin/master) and > localtest (not in the origin repository). The localtest branch shouldn't be > published because it is just used for some temporary testing and doesn't even > work. It will be pushed during 'release:prepare'. > Suggested behaviour: use 'git push origin <currentbranch>:<currentbranch>', > or even better, query for which remote repository to push to (found in > .git/config) and which branch to push from and to. For me, it would be great > to have a 'confirm push' before doing it so as to keep things clean, but > maybe that is quite complex. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira