git-push segfault
Steps to reproduce:
git clone /path/to/some/repo
cd repo
git config --unset branch.master.remote
git push
(seg fault)
I'm using version 1.7.0.
Dale
Quoted 9 lines · Dale Rowley
Steps to reproduce:
git clone /path/to/some/repo
cd repo
git config --unset branch.master.remote
git push
(seg fault)I'm using version 1.7.0.
I can't reproduce here, using the following script:
-- >8 --
#!/bin/sh
rm -rf parent child
mkdir parent && (
cd parent &&
git init
) &&
git clone parent child &&
cd child &&
git config --unset branch.master.remote &&
git push
-- 8< --
Does that trigger the problem for you? If not, can you show what is different between your earlier reproduction recipe and this one?
-Peff
On Wed, 24 Feb 2010 01:36:06 +0000, Jeff King wrote:
...
Quoted 1 line
#!/bin/sh
...
Quoted 2 lines
git clone parent child &&
cd child &&
How about 'set -xe' instead of all the &&?
Andreas
Quoted 8 lines · Andreas Krey
On Wed, 24 Feb 2010 01:36:06 +0000, Jeff King wrote:
...Quoted 1 line
#!/bin/sh
...
Quoted 2 lines
git clone parent child &&
cd child &&How about 'set -xe' instead of all the &&?
I long ago stopped trying to remember all of the places where "-e" works and where it doesn't, and just use explicit "&&" (or "|| exit 1"). For example, the subshell in my recipe needs an explicit error check under dash, but will exit correctly using bash. I seem to recall there are some other gotchas, but it has been a long time since I looked.
At any rate, this is not even code for inclusion in git. It is "please cut and paste this and tell me if it breaks". So I am not too worried about style.
-Peff
Quoted 1 line · Jeff King
On Wed, Feb 24, 2010 at 09:22:14AM +0100, Andreas Krey wrote:
...
Quoted 1 line
Quoted 1 line
How about 'set -xe' instead of all the &&?
...
Quoted 1 line
At any rate, this is not even code for inclusion in git.
That was why I was asking. In throwaway scripts -e as well as -x is rather practical (esp. the latter); I wouldn't use that in 'real' scripts. Probably it's better not to set a bad example in posted throwaway scripts, though. :-)
Andreas
Quoted 2 lines · Dale Rowley <ddrowley3 <at> juno.com> writes:
git config --unset branch.master.remote
git push
Yes, those 2 commands don't make much sense. I should have mentioned that this was just the simplest way to reproduce the problem. My original and more realistic scenario:
git clone /path/to/some/repo
cd repo
git remote add remote1 <url>
git remote add remote2 <url>
git config --unset branch.master.remote
git push remote1
(seg fault)
The reason for unsetting branch.master.remote was to force git to complain and abort if I accidentally typed 'git push' instead of 'git push <remote>' (I wanted to avoid accidentally pushing to the wrong remote repo).
Dale