git svn --version requires working copy

2016-08-10 Thread Michal Čihař
Hi

I've just noticed, that running git svn --version requires working copy,
what is quite ugly to require working copy just to figure out if git svn
is installed and what version.

$ git svn --version
fatal: Not a git repository (or any parent up to mount point /home)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
Unable to find .git directory
 at /usr/lib/git-core/git-svn line 347.

Is this expected behavior?

Thanks
-- 
    Michal Čihař | http://cihar.com/ | https://weblate.org/



signature.asc
Description: OpenPGP digital signature


Re: git cat-file -e behavior

2016-02-29 Thread Michal Čihař
Hi

Dne 29.2.2016 v 12:44 Jeff King napsal(a):
> It looks like it has been this way forever. The first thing we do with
> the object is resolve its name to a sha1, and that's where the error you
> see comes from. And then we actually check whether we have the object.
> 
> I think the intended use was to feed it a sha1 to see if it exists. Then
> the name-resolution step is a noop.

I found this as best way to check whether file exists in branch.
Checking git ls-tree output seems less error prone than checking return
value of git cat-file -e...

> I'm not sure if the behavior you are seeing is all that bad (the
> documentation could be read as suppressing the normal stdout output, but
> error messages remain), 

I understand this, that's why I'm asking whether it's expected output or
not :-).

-- 
Michal Čihař | http://cihar.com | http://blog.cihar.com



signature.asc
Description: OpenPGP digital signature


git cat-file -e behavior

2016-02-29 Thread Michal Čihař
Hi

the documentation for "git cat-file -e" says:

> Suppress all output; instead exit with zero status if  exists
and is a valid object.

However running it on non existing object will complain "fatal: Not a
valid object name".

$ git cat-file -e master:README.rst
$ echo $?
0
$ git cat-file -e master:foo
fatal: Not a valid object name master:foo
$ echo $?
128

Is the output in this case expected?

I'm currently running 2.7.0.

-- 
Michal Čihař | http://cihar.com | http://blog.cihar.com



signature.asc
Description: OpenPGP digital signature