Module: sip-router Branch: master Commit: 8d41196809f014e00346785b6517bd2c4051901a URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=8d411968...
Author: Henning Westerholt henning.westerholt@1und1.de Committer: Henning Westerholt henning.westerholt@1und1.de Date: Mon Nov 24 19:13:59 2008 +0100
Merge ssh://git.sip-router.org/sip-router into my_branch
---
On Nov 24, 2008 at 19:29, Henning Westerholt henning.westerholt@1und1.de wrote:
Module: sip-router Branch: master Commit: 8d41196809f014e00346785b6517bd2c4051901a URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=8d411968...
Author: Henning Westerholt henning.westerholt@1und1.de Committer: Henning Westerholt henning.westerholt@1und1.de Date: Mon Nov 24 19:13:59 2008 +0100
Merge ssh://git.sip-router.org/sip-router into my_branch
That should have been:
Merge commit 'origin/henning/trie' into master
* commit 'origin/henning/trie': add trie to library directory add SHM_MEM_ERROR and PKG_MEM_ERROR logging macros to mem.h
Henning did you forgot to set merge log to true in your git config (~/.gitconfig or per repository in .git/config)? ( git config --get merge.log # to see it's value git config --global merge.log true # to set it to true)
Andrei
On Monday 24 November 2008, Andrei Pelinescu-Onciul wrote:
On Nov 24, 2008 at 19:29, Henning Westerholt henning.westerholt@1und1.de
wrote:
Module: sip-router Branch: master Commit: 8d41196809f014e00346785b6517bd2c4051901a URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=8d411 96809f014e00346785b6517bd2c4051901a
Author: Henning Westerholt henning.westerholt@1und1.de Committer: Henning Westerholt henning.westerholt@1und1.de Date: Mon Nov 24 19:13:59 2008 +0100
Merge ssh://git.sip-router.org/sip-router into my_branch
That should have been:
Merge commit 'origin/henning/trie' into master
- commit 'origin/henning/trie': add trie to library directory add SHM_MEM_ERROR and PKG_MEM_ERROR logging macros to mem.h
Henning did you forgot to set merge log to true in your git config (~/.gitconfig or per repository in .git/config)? ( git config --get merge.log # to see it's value git config --global merge.log true # to set it to true)
Hi Andrei,
i'm still trying to wrap my head around this git. ;-) Aparently this merged the content from the henning/trie branch into the trunk, the operation i wanted to do. But i don't understand the log message, 'my_branch' is a local branch on my machine, not sure why this show up, and it should be also the other way round. And the diff for the revision is also the other way round.
Perhaps i just did it the wrong way. :-/
henning@ca:~/projects/openser/sip-router$ git config --get merge.log true
Perhaps it make sense to revert this commit?
Cheers,
Henning
On Monday 24 November 2008, Henning Westerholt wrote:
[..]
Merge commit 'origin/henning/trie' into master
- commit 'origin/henning/trie': add trie to library directory add SHM_MEM_ERROR and PKG_MEM_ERROR logging macros to mem.h
Henning did you forgot to set merge log to true in your git config (~/.gitconfig or per repository in .git/config)? ( git config --get merge.log # to see it's value git config --global merge.log true # to set it to true)
Hi Andrei,
i'm still trying to wrap my head around this git. ;-) Aparently this merged the content from the henning/trie branch into the trunk, the operation i wanted to do. But i don't understand the log message, 'my_branch' is a local branch on my machine, not sure why this show up, and it should be also the other way round. And the diff for the revision is also the other way round.
Perhaps i just did it the wrong way. :-/
henning@ca:~/projects/openser/sip-router$ git config --get merge.log true
Perhaps it make sense to revert this commit?
Andrei,
if i take a look at git diff for this revision i get a bunch of completely unrelated changes. This is not good. I tried of course with '--dry-run --verbose' to check the changes before the commit, but this don't showed anything useful. This 'git push' also don't asked me for confirmation of my changes, and the git diff or git status i tried before pushing also don't showed anything. From the usability POV i think git still has some way to go. ;)
So what is the correct revision that needs to be reverted?
from git log mem/mem.h: f34610e3ec970664efab940592dd2cbd0f48260b from the commit mail: 8d41196809f014e00346785b6517bd2c4051901a
Thanks,
Henning
On Nov 24, 2008 at 20:30, Henning Westerholt henning.westerholt@1und1.de wrote:
On Monday 24 November 2008, Henning Westerholt wrote:
[..]
Merge commit 'origin/henning/trie' into master
- commit 'origin/henning/trie': add trie to library directory add SHM_MEM_ERROR and PKG_MEM_ERROR logging macros to mem.h
Henning did you forgot to set merge log to true in your git config (~/.gitconfig or per repository in .git/config)? ( git config --get merge.log # to see it's value git config --global merge.log true # to set it to true)
Hi Andrei,
i'm still trying to wrap my head around this git. ;-) Aparently this merged the content from the henning/trie branch into the trunk, the operation i wanted to do. But i don't understand the log message, 'my_branch' is a local branch on my machine, not sure why this show up, and it should be also the other way round. And the diff for the revision is also the other way round.
Perhaps i just did it the wrong way. :-/
henning@ca:~/projects/openser/sip-router$ git config --get merge.log true
Perhaps it make sense to revert this commit?
Andrei,
if i take a look at git diff for this revision i get a bunch of completely unrelated changes. This is not good.
git diff 7e69be0 origin/master
shows me only lib/trie addition, and 2 mem/mem.h macros (PKG_MEM_ERROR and SHM_MEM_ERROR).
7e69be0 is the shor form of 7e69be0441a98653ea0d94c831f64a2947aa4fff which is the previous commit on master branch (git log or git log -2).
Did you updated from the repo before trying git diff (or else you don't have the latest version)? (git fetch origin)
I tried of course with '--dry-run --verbose' to check the changes before the commit, but this don't showed anything useful.
The problem was with git merge. Anyway the best way is that before git push-ing you should look at the branch tree (gitk) and/or at the log (git log). If it looks ok then git push .... (that's because is much easier to revert changes locally)
This 'git push' also don't asked me for confirmation of my changes, and the git diff or git status i tried before pushing also don't showed anything. From the usability POV i think git still
They didn't show anything because it was ok (the code is ok), only the merge message is wrong.
has some way to go. ;)
So what is the correct revision that needs to be reverted?
from git log mem/mem.h: f34610e3ec970664efab940592dd2cbd0f48260b from the commit mail: 8d41196809f014e00346785b6517bd2c4051901a
Maybe I've got you wrong: do you want to revert the mem.h changes? the merge log commit message? the whole merge?
Andrei
On Monday 24 November 2008, Andrei Pelinescu-Onciul wrote:
[..]
So what is the correct revision that needs to be reverted?
from git log mem/mem.h: f34610e3ec970664efab940592dd2cbd0f48260b from the commit mail: 8d41196809f014e00346785b6517bd2c4051901a
Maybe I've got you wrong: do you want to revert the mem.h changes? the merge log commit message? the whole merge?
Hi Andrei,
i'm sorry, but i need to bother you again with my git problems. I reverted the commit in question correctly, i think. Now i simply want to merge this branch. I tried a few times like you described, and also on a fresh checkout:
git clone ssh://git.sip-router.org/sip-router cd sip-router git branch trie origin/henning/trie Branch trie set up to track remote branch refs/remotes/origin/henning/trie.
git diff master trie
Shows correctly my changes, and also some other unrelated stuff because of the master branch advanced after the branching.
git branch -a * master
git merge trie Already up-to-date.
Why this don't work? Perhaps something wrong in my configuration? Trying to merge directly from the remote branch also not work:
git merge origin/henning/trie Already up-to-date.
Even if 'git diff master origin/henning/trie' shows the correct diff.
Henning
On Nov 25, 2008 at 13:54, Henning Westerholt henning.westerholt@1und1.de wrote:
On Monday 24 November 2008, Andrei Pelinescu-Onciul wrote:
[..]
So what is the correct revision that needs to be reverted?
from git log mem/mem.h: f34610e3ec970664efab940592dd2cbd0f48260b from the commit mail: 8d41196809f014e00346785b6517bd2c4051901a
Maybe I've got you wrong: do you want to revert the mem.h changes? the merge log commit message? the whole merge?
Hi Andrei,
i'm sorry, but i need to bother you again with my git problems. I reverted the commit in question correctly, i think. Now i simply want to merge this branch. I tried a few times like you described, and also on a fresh checkout:
git clone ssh://git.sip-router.org/sip-router cd sip-router git branch trie origin/henning/trie Branch trie set up to track remote branch refs/remotes/origin/henning/trie.
git diff master trie
Shows correctly my changes, and also some other unrelated stuff because of the master branch advanced after the branching.
git branch -a
- master
git merge trie Already up-to-date.
Why this don't work? Perhaps something wrong in my configuration? Trying to merge directly from the remote branch also not work:
Your configuration is ok. I was wrong recommending git revert for this, I think it can't work, because it tries to merge, sees that trie was merged in the past and then it tries to merge only what's new on trie since the past merge...
Sorry, I think git revert is not good for undoing a merge commit. It does undo the code changes, but it leaves the merge in the history and so future merges with the same branch think the branch was already merged.
I don't know if this can be done in another way, but for now I'm going to reset master to the commit just before the merge (7e69be). I'll send a message on sr-dev after I do it and then you could retry the merge from the beginning.
Andrei
[...]
On Tuesday 25 November 2008, Andrei Pelinescu-Onciul wrote:
[..]
git merge trie Already up-to-date.
Why this don't work? Perhaps something wrong in my configuration? Trying to merge directly from the remote branch also not work:
Your configuration is ok. I was wrong recommending git revert for this, I think it can't work, because it tries to merge, sees that trie was merged in the past and then it tries to merge only what's new on trie since the past merge...
Sorry, I think git revert is not good for undoing a merge commit. It does undo the code changes, but it leaves the merge in the history and so future merges with the same branch think the branch was already merged.
I don't know if this can be done in another way, but for now I'm going to reset master to the commit just before the merge (7e69be). I'll send a message on sr-dev after I do it and then you could retry the merge from the beginning.
Hi Andrei,
ok, thanks for the reset. I'll retry my merge later.
Cheers,
Henning
On Nov 24, 2008 at 19:46, Henning Westerholt henning.westerholt@1und1.de wrote:
On Monday 24 November 2008, Andrei Pelinescu-Onciul wrote:
On Nov 24, 2008 at 19:29, Henning Westerholt henning.westerholt@1und1.de
wrote:
Module: sip-router Branch: master Commit: 8d41196809f014e00346785b6517bd2c4051901a URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=8d411 96809f014e00346785b6517bd2c4051901a
Author: Henning Westerholt henning.westerholt@1und1.de Committer: Henning Westerholt henning.westerholt@1und1.de Date: Mon Nov 24 19:13:59 2008 +0100
Merge ssh://git.sip-router.org/sip-router into my_branch
That should have been:
Merge commit 'origin/henning/trie' into master
- commit 'origin/henning/trie': add trie to library directory add SHM_MEM_ERROR and PKG_MEM_ERROR logging macros to mem.h
Henning did you forgot to set merge log to true in your git config (~/.gitconfig or per repository in .git/config)? ( git config --get merge.log # to see it's value git config --global merge.log true # to set it to true)
Hi Andrei,
i'm still trying to wrap my head around this git. ;-) Aparently this merged the content from the henning/trie branch into the trunk, the operation i wanted to do. But i don't understand the log message, 'my_branch' is a local branch on my machine, not sure why this show up, and it should be also the other way round. And the diff for the revision is also the other way round.
Perhaps i just did it the wrong way. :-/
henning@ca:~/projects/openser/sip-router$ git config --get merge.log true
Perhaps it make sense to revert this commit?
No, the commit is ok, only the last log message is broken.
You probably where on "my_branch" and you did a git pull ssh://git.sip-router.org/sip-router master and then git push origin my_branch:master
So what you did was to merge the remote version of master into "my_branch" and then update master with my_branch version.
What you should have done is to merge trie or "my_branch" into master:
git fetch origin # to get up-to-date origin/ branches, including master git checkout -b master origin/master # local branch following # origin/master # now you are on branch master (local version) git merge trie git log or gitk to see if everything looks ok git push origin master:master
If you already have a local master branch tracking origin/master you could do instead: git checkout master # switch to master git pull origin master # equiv. with git fetch origin; git merge master git merge trie # git log or gitk to see if everything looks ok git push origin master:master
Note that some of this commands have shorter forms (if not specified some parameters take some default values and some of this values can be configured in the git config on a per branch basis, e.g. the default branch to push into or to pull form).
Note2: you don't have to specify the whole reop name path (ssh://git.sip-router.org/sip-router), origin is set by default to the repo from where you cloned, so you could always use origin.
To revert the commit (it's not needed since we have only a strange merge message, but the rest is ok, but it might be good practice), there are 2 possibilities:
1. you could use git revert (it will create a new commit reverting the old one): checkout the master branch: - if you don't have a local master: git fetch origin; git checkout -b master origin/master - if you already have a master tracking origin/master (created in a similar way some time ago): git checkout master # switch to master git pull origin master revert the commit git revert -m X commit_id where comit_id is the commit you want reversed (in this case 8d41196809f014e00346785b6517bd2c4051901a) and X is the merge parent number that should be the mainline (in this case I think it's 2) You could try git revert --no-commit -m 2 8d41196809f014e00346785b6517bd2c4051901a and see if it look ok (and if it does remove --no-commit and retry).
After this and after making sure the log looks ok (gitk, or git log) you can git push origin master:master, or maybe git push origin master:tmp/test just to have an extra check. WARNING: do not push if it doesn't look ok (if you use the wrong -m value you might end up reverting master into your branch :-)).
2. we could revert it the hard way without leaving "commit" traces (by directly editing the master branch on sip-router.org and making it point to the previous comit). The problem with this is that if people have already checked out the current master version they will have problems updating, but since I don't expect to have more then 2 or 3 people who do this at this point we could try it as an experiment (in the future we might have to revert a commit the hard way so we might try it now when this will not cause any serious problems).
So do you want it reverted and if so what method do you prefer to try?
Andrei
On Nov 24, 2008 at 20:45, Andrei Pelinescu-Onciul andrei@iptel.org wrote:
On Nov 24, 2008 at 19:46, Henning Westerholt henning.westerholt@1und1.de wrote:
On Monday 24 November 2008, Andrei Pelinescu-Onciul wrote:
On Nov 24, 2008 at 19:29, Henning Westerholt henning.westerholt@1und1.de
wrote:
Module: sip-router Branch: master Commit: 8d41196809f014e00346785b6517bd2c4051901a URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=8d411 96809f014e00346785b6517bd2c4051901a
Author: Henning Westerholt henning.westerholt@1und1.de Committer: Henning Westerholt henning.westerholt@1und1.de Date: Mon Nov 24 19:13:59 2008 +0100
Merge ssh://git.sip-router.org/sip-router into my_branch
That should have been:
Merge commit 'origin/henning/trie' into master
- commit 'origin/henning/trie': add trie to library directory add SHM_MEM_ERROR and PKG_MEM_ERROR logging macros to mem.h
Henning did you forgot to set merge log to true in your git config (~/.gitconfig or per repository in .git/config)? ( git config --get merge.log # to see it's value git config --global merge.log true # to set it to true)
Hi Andrei,
i'm still trying to wrap my head around this git. ;-) Aparently this merged the content from the henning/trie branch into the trunk, the operation i wanted to do. But i don't understand the log message, 'my_branch' is a local branch on my machine, not sure why this show up, and it should be also the other way round. And the diff for the revision is also the other way round.
Perhaps i just did it the wrong way. :-/
henning@ca:~/projects/openser/sip-router$ git config --get merge.log true
Perhaps it make sense to revert this commit?
No, the commit is ok, only the last log message is broken.
You probably where on "my_branch" and you did a git pull ssh://git.sip-router.org/sip-router master and then git push origin my_branch:master
So what you did was to merge the remote version of master into "my_branch" and then update master with my_branch version.
What you should have done is to merge trie or "my_branch" into master:
git fetch origin # to get up-to-date origin/ branches, including master git checkout -b master origin/master # local branch following # origin/master # now you are on branch master (local version) git merge trie git log or gitk to see if everything looks ok git push origin master:master
If you already have a local master branch tracking origin/master you could do instead: git checkout master # switch to master git pull origin master # equiv. with git fetch origin; git merge master git merge trie # git log or gitk to see if everything looks ok git push origin master:master
Note that some of this commands have shorter forms (if not specified some parameters take some default values and some of this values can be configured in the git config on a per branch basis, e.g. the default branch to push into or to pull form).
Note2: you don't have to specify the whole reop name path (ssh://git.sip-router.org/sip-router), origin is set by default to the repo from where you cloned, so you could always use origin.
To revert the commit (it's not needed since we have only a strange merge message, but the rest is ok, but it might be good practice), there are 2 possibilities:
- you could use git revert (it will create a new commit reverting the
old one): checkout the master branch:
- if you don't have a local master: git fetch origin; git checkout -b master origin/master
- if you already have a master tracking origin/master (created in a similar way some time ago): git checkout master # switch to master git pull origin master
revert the commit git revert -m X commit_id where comit_id is the commit you want reversed (in this case 8d41196809f014e00346785b6517bd2c4051901a) and X is the merge parent number that should be the mainline (in this case I think it's 2) You could try git revert --no-commit -m 2 8d41196809f014e00346785b6517bd2c4051901a and see if it look ok (and if it does remove --no-commit and retry).
After this and after making sure the log looks ok (gitk, or git log) you can git push origin master:master, or maybe git push origin master:tmp/test just to have an extra check. WARNING: do not push if it doesn't look ok (if you use the wrong -m value you might end up reverting master into your branch :-)).
- we could revert it the hard way without leaving "commit" traces
(by directly editing the master branch on sip-router.org and making it point to the previous comit). The problem with this is that if people have already checked out the current master version they will have problems updating, but since I don't expect to have more then 2 or 3 people who do this at this point we could try it as an experiment (in the future we might have to revert a commit the hard way so we might try it now when this will not cause any serious problems).
Just for reference, you could do it without any editing on sip-router.org if we would allow non fast forward updates (right now they are disabled globally):
git checkout master git pull origin master # make sure we have an up-to-date ver. git log --pretty=oneline -5 # look at the summary of the last 5 commits # we see that we want to reverse the last commit (the one just on top)
# try reverting to parent 1 (since this particular commit is a merge, it # has 2 parents instead of 1); if we look at gitk or at the more # detailed log or think on how we merged in the first place we can find out # that the second parent is the correct answer, but let's assume we # are in a hurry and we try all options
git reset --hard HEAD^1 # warning: will loose all local non-committed # changes (see git help reset) HEAD is now at 99d1967 add trie to library directory
# this is not good, we reverted to the wrong parent # => undo the changes
git reset --hard ORIG_HEAD git log --pretty=oneline -5 # make sure we properly undo'ed # try the second parent git reset --hard HEAD^2 HEAD is now at 7e69be0 Merge commit 'origin/andrei/fixups' # look ok
git log --pretty=oneline -5 # just to be sure (not really needed)
git push origin +master:master # do non-fast forward update
# the last git push is equivalent to login in sip-router.org # ,editing refs/heads/master in the sip-router repo and setting it # to 7e69be0441a98653ea0d94c831f64a2947aa4fff # the '+' forces a non-fast forward update (but right now is disabled # on sip-router.org)
After a non fast forward update to a public branch, all the people who pull'ed out the version just before the update/revert have a problem: they won't see the revert. In our particular case this is not a problem, since after the revert we would commit the same thing with another merge message, however in general all the people who pulled in the time window before the revert should do one of:
- git fetch origin; git reset --hard FETCH_HEAD if they don't have _any_ local changes that they care about (reset --hard will destroy all local changes) - git fetch origin; git rebase FETCH_HEAD (local changes are not lost)
Andrei
On Monday 24 November 2008, Andrei Pelinescu-Onciul wrote:
Henning did you forgot to set merge log to true in your git config (~/.gitconfig or per repository in .git/config)? ( git config --get merge.log # to see it's value git config --global merge.log true # to set it to true)
i'm still trying to wrap my head around this git. ;-) Aparently this merged the content from the henning/trie branch into the trunk, the operation i wanted to do. But i don't understand the log message, 'my_branch' is a local branch on my machine, not sure why this show up, and it should be also the other way round. And the diff for the revision is also the other way round.
Perhaps i just did it the wrong way. :-/
henning@ca:~/projects/openser/sip-router$ git config --get merge.log true
Perhaps it make sense to revert this commit?
No, the commit is ok, only the last log message is broken.
You probably where on "my_branch" and you did a git pull ssh://git.sip-router.org/sip-router master and then git push origin my_branch:master
So what you did was to merge the remote version of master into "my_branch" and then update master with my_branch version.
Hi Andrei,
yes, correct. I read on some git docs that this is needed in order to merge the branches. This were apparently wrong.
What you should have done is to merge trie or "my_branch" into master:
git fetch origin # to get up-to-date origin/ branches, including master git checkout -b master origin/master # local branch following # origin/master # now you are on branch master (local version)
Ah, ok, understand.
git merge trie git log or gitk to see if everything looks ok git push origin master:master
Ok
If you already have a local master branch tracking origin/master you could do instead: git checkout master # switch to master git pull origin master # equiv. with git fetch origin; git merge master git merge trie # git log or gitk to see if everything looks ok git push origin master:master
I'll try this the next time, perhaps in the test branch.
Note that some of this commands have shorter forms (if not specified some parameters take some default values and some of this values can be configured in the git config on a per branch basis, e.g. the default branch to push into or to pull form).
Note2: you don't have to specify the whole reop name path (ssh://git.sip-router.org/sip-router), origin is set by default to the repo from where you cloned, so you could always use origin.
Ah, good to know!
To revert the commit (it's not needed since we have only a strange merge message, but the rest is ok, but it might be good practice), there are 2 possibilities:
- you could use git revert (it will create a new commit reverting the
old one): checkout the master branch:
- if you don't have a local master: git fetch origin; git checkout -b master origin/master
- if you already have a master tracking origin/master (created in a similar way some time ago): git checkout master # switch to master git pull origin master
revert the commit git revert -m X commit_id where comit_id is the commit you want reversed (in this case 8d41196809f014e00346785b6517bd2c4051901a) and X is the merge parent number that should be the mainline (in this case I think it's 2) You could try git revert --no-commit -m 2 8d41196809f014e00346785b6517bd2c4051901a and see if it look ok (and if it does remove --no-commit and retry).
After this and after making sure the log looks ok (gitk, or git log) you can git push origin master:master, or maybe git push origin master:tmp/test just to have an extra check. WARNING: do not push if it doesn't look ok (if you use the wrong -m value you might end up reverting master into your branch :-)).
- we could revert it the hard way without leaving "commit" traces
(by directly editing the master branch on sip-router.org and making it point to the previous comit). The problem with this is that if people have already checked out the current master version they will have problems updating, but since I don't expect to have more then 2 or 3 people who do this at this point we could try it as an experiment (in the future we might have to revert a commit the hard way so we might try it now when this will not cause any serious problems).
I'll try the first method. Thanks for your help and explanations,
Henning