Currently I do:
* clone a repo * setup git & hooks
# patch 1:
* apply my changes * commit * execute git-review
# patch 2:
* apply my changes * commit
FAIL - the new commit it depending on previous commit - I can't push
What am I supposed to do in order to push multiple separate patches?
GIT-IDIOT way please, no long explanations, just commands and examples. Thanks
Normally:
* clone a repo * setup git & hooks
# patch 1:
* git checkout -b some_branch_name * apply my changes * git commit -a * git review
# patch 2:
* git checkout production (or master on non-puppet repositories) * git pull * git checkout -b some_other_branch_name * apply my changes * git commit -a * git review
Nik
On Wed, Nov 20, 2013 at 8:13 AM, Petr Bena benapetr@gmail.com wrote:
Currently I do:
- clone a repo
- setup git & hooks
# patch 1:
- apply my changes
- commit
- execute git-review
# patch 2:
- apply my changes
- commit
FAIL - the new commit it depending on previous commit - I can't push
What am I supposed to do in order to push multiple separate patches?
GIT-IDIOT way please, no long explanations, just commands and examples. Thanks
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
petanb@srv:~/puppet/modules/toollabs/manifests$ git checkout production Already on 'production' Your branch is ahead of 'origin/production' by 2 commits.
this keep my change depending on previous commit ^ and FAIL again
On Wed, Nov 20, 2013 at 2:19 PM, Nikolas Everett neverett@wikimedia.org wrote:
Normally:
- clone a repo
- setup git & hooks
# patch 1:
- git checkout -b some_branch_name
- apply my changes
- git commit -a
- git review
# patch 2:
- git checkout production (or master on non-puppet repositories)
- git pull
- git checkout -b some_other_branch_name
- apply my changes
- git commit -a
- git review
Nik
On Wed, Nov 20, 2013 at 8:13 AM, Petr Bena benapetr@gmail.com wrote:
Currently I do:
- clone a repo
- setup git & hooks
# patch 1:
- apply my changes
- commit
- execute git-review
# patch 2:
- apply my changes
- commit
FAIL - the new commit it depending on previous commit - I can't push
What am I supposed to do in order to push multiple separate patches?
GIT-IDIOT way please, no long explanations, just commands and examples. Thanks
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
if I do this I get
- patch1 -- patch 2 (depends on patch1)
in gerrit. What I need is, to make 2 patches that are completely unrelated
On Wed, Nov 20, 2013 at 2:50 PM, Petr Bena benapetr@gmail.com wrote:
petanb@srv:~/puppet/modules/toollabs/manifests$ git checkout production Already on 'production' Your branch is ahead of 'origin/production' by 2 commits.
this keep my change depending on previous commit ^ and FAIL again
On Wed, Nov 20, 2013 at 2:19 PM, Nikolas Everett neverett@wikimedia.org wrote:
Normally:
- clone a repo
- setup git & hooks
# patch 1:
- git checkout -b some_branch_name
- apply my changes
- git commit -a
- git review
# patch 2:
- git checkout production (or master on non-puppet repositories)
- git pull
- git checkout -b some_other_branch_name
- apply my changes
- git commit -a
- git review
Nik
On Wed, Nov 20, 2013 at 8:13 AM, Petr Bena benapetr@gmail.com wrote:
Currently I do:
- clone a repo
- setup git & hooks
# patch 1:
- apply my changes
- commit
- execute git-review
# patch 2:
- apply my changes
- commit
FAIL - the new commit it depending on previous commit - I can't push
What am I supposed to do in order to push multiple separate patches?
GIT-IDIOT way please, no long explanations, just commands and examples. Thanks
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
On Wed, 20 Nov 2013 14:50:55 +0100, Petr Bena benapetr@gmail.com wrote:
petanb@srv:~/puppet/modules/toollabs/manifests$ git checkout production Already on 'production' Your branch is ahead of 'origin/production' by 2 commits.
Run `git reset --hard origin/production` to restore your local branch to the "pristine" state (same as the remote one). beware, as this kills all unsubmitted patches and all uncommitted work.
when I did a new branch before git-review it now show this as "topic" in gerrit: https://gerrit.wikimedia.org/r/#/c/96484/
will it merge this to production branch?
On Wed, Nov 20, 2013 at 2:59 PM, Bartosz Dziewoński matma.rex@gmail.com wrote:
On Wed, 20 Nov 2013 14:50:55 +0100, Petr Bena benapetr@gmail.com wrote:
petanb@srv:~/puppet/modules/toollabs/manifests$ git checkout production Already on 'production' Your branch is ahead of 'origin/production' by 2 commits.
Run `git reset --hard origin/production` to restore your local branch to the "pristine" state (same as the remote one). beware, as this kills all unsubmitted patches and all uncommitted work.
-- Matma Rex
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
On Wed, Nov 20, 2013 at 9:01 AM, Petr Bena benapetr@gmail.com wrote:
when I did a new branch before git-review it now show this as "topic" in gerrit: https://gerrit.wikimedia.org/r/#/c/96484/
will it merge this to production branch?
Yes.
aha I see now, I should have branch before patch1. I didn't. What am I supposed to do now?
On Wed, Nov 20, 2013 at 2:19 PM, Nikolas Everett neverett@wikimedia.org wrote:
Normally:
- clone a repo
- setup git & hooks
# patch 1:
- git checkout -b some_branch_name
- apply my changes
- git commit -a
- git review
# patch 2:
- git checkout production (or master on non-puppet repositories)
- git pull
- git checkout -b some_other_branch_name
- apply my changes
- git commit -a
- git review
Nik
On Wed, Nov 20, 2013 at 8:13 AM, Petr Bena benapetr@gmail.com wrote:
Currently I do:
- clone a repo
- setup git & hooks
# patch 1:
- apply my changes
- commit
- execute git-review
# patch 2:
- apply my changes
- commit
FAIL - the new commit it depending on previous commit - I can't push
What am I supposed to do in order to push multiple separate patches?
GIT-IDIOT way please, no long explanations, just commands and examples. Thanks
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
I used my favorite command
rm -rf <repository> && git clone again
so it's fixed for now, but it would be cool to know how to fix that anyway
On Wed, Nov 20, 2013 at 2:55 PM, Petr Bena benapetr@gmail.com wrote:
aha I see now, I should have branch before patch1. I didn't. What am I supposed to do now?
On Wed, Nov 20, 2013 at 2:19 PM, Nikolas Everett neverett@wikimedia.org wrote:
Normally:
- clone a repo
- setup git & hooks
# patch 1:
- git checkout -b some_branch_name
- apply my changes
- git commit -a
- git review
# patch 2:
- git checkout production (or master on non-puppet repositories)
- git pull
- git checkout -b some_other_branch_name
- apply my changes
- git commit -a
- git review
Nik
On Wed, Nov 20, 2013 at 8:13 AM, Petr Bena benapetr@gmail.com wrote:
Currently I do:
- clone a repo
- setup git & hooks
# patch 1:
- apply my changes
- commit
- execute git-review
# patch 2:
- apply my changes
- commit
FAIL - the new commit it depending on previous commit - I can't push
What am I supposed to do in order to push multiple separate patches?
GIT-IDIOT way please, no long explanations, just commands and examples. Thanks
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
Hi,
On Wed, Nov 20, 2013 at 02:56:44PM +0100, Petr Bena wrote:
I used my favorite command
rm -rf <repository> && git clone again
so it's fixed for now, but it would be cool to know how to fix that anyway
Assuming * you are on branch production, * production branch does no longer point to origin's branch, and * you want a new branch where you're currently at.
Then issue
git branch new_branch_name HEAD git reset --hard origin
(Caution: that will drop uncommitted changes)
Afterwards: * you're still on production branch, * the local production branch matches origin, and * your previous commits to the production branch are at new_branch_name.
Best regards, Christian
On 11/20/2013 08:55 AM, Petr Bena wrote:
aha I see now, I should have branch before patch1. I didn't. What am I supposed to do now?
I think:
git checkout production git checkout -b patch1
(that was just to "back up" patch1, in case you didn't have it anywhere else)
git checkout production git reset --hard origin/production
would have done what you want. That would set your production branch to the last version of production fetched from Gerrit (so not including any unmerged changes).
Note, --hard erases any uncommitted changes.
Matt Flaschen
On 11/20/13 7:13 AM, Petr Bena wrote:
<snip>
What am I supposed to do in order to push multiple separate patches?
The short answer is: If you're working on two unrelated things, do them on separate branches.
If you /already/ have two patches on the same branch and realize you want to split them out, you're a good candidate for a fresh branch + a cherry-pick, as described here:
https://wikitech.wikimedia.org/wiki/Help:Git_rebase#Don.27t_panic
I won't go so far as to say that fresh branch + cherry-pick fixes /every/ git problem, but it fixes a lot of 'em! The only caveat is that this only works if your workflow generally involves storing all your pending changes in patches rather than as local file diffs or in the index.
I'm interested in elaborating the instructions on that wiki page -- let me know if it's confusing.
-Andrew
wikitech-l@lists.wikimedia.org