[Funky] "git -p cmd" inside a bare repository

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If you have a bare repository and try this there:

	$ PAGER=head git show HEAD:gcc/ChangeLog

it works as expected, but if you explicitly ask for pagination, like
this:

	$ PAGER=head git -p show HEAD:gcc/ChangeLog

you would get a very funky error message:

	fatal: ambiguous argument 'HEAD:gcc/ChangeLog': unknown revision or path not in the working tree.
	Use '--' to separate paths from revisions

as if we are working with a repository with working tree.

I originally noticed this with ls-tree.  The symptom is a bit different:

	$ git -p ls-tree HEAD
	fatal: Not a valid object name HEAD



I _think_ what is happening is that setup_pager() tries to run
git_config(), which runs setup(), and then RUN_SETUP set for "ls-tree"
(or "show") internal command runs setup again.  HEAD is given to
resolve_ref() and git_path("%s", ref) makes it to ".git/HEAD", even
though in a bare repository git_dir should be set to ".", and of course
we cannot find such a path in the git directory.




-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux