Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Fix "Not a valid object name HEAD0" w/ p4 unshelve#605

Closed
mdymike wants to merge 1 commit intogit:mastergit/git:masterfrom
mdymike:masterCopy head branch name to clipboard
Closed

Fix "Not a valid object name HEAD0" w/ p4 unshelve#605
mdymike wants to merge 1 commit intogit:mastergit/git:masterfrom
mdymike:masterCopy head branch name to clipboard

Conversation

@mdymike
Copy link
Contributor

@mdymike mdymike commented May 3, 2019

git p4 unshelve fails with "fatal: Not a valid object name HEAD0" and "Command failed: git cat-file commit HEAD^0" on certain systems e.g. git version 2.21.0.windows.1 / python 2.7.16

It seems that the python pOpen implementation drops the ^ character when invoked using a string instead of an array as first argument.

Solution is to use the array format of passing the command to fOpen, which is preferred (see https://docs.python.org/2/library/subprocess.html) and is used in other parts of this code anyway.

Thanks for taking the time to contribute to Git! Please be advised that the
Git community does not use github.com for their contributions. Instead, we use
a mailing list (git@vger.kernel.org) for code submissions, code reviews, and
bug reports. Nevertheless, you can use GitGitGadget (https://gitgitgadget.github.io/)
to conveniently send your Pull Requests commits to our mailing list.

Please read the "guidelines for contributing" linked above!

git p4 unshelve fails with "fatal: Not a valid object name HEAD0" and "Command failed: git cat-file commit HEAD^0" on certain systems e.g. git version 2.21.0.windows.1 / python 2.7.16

It seems that the python pOpen implementation drops the ^ character when invoked using a string instead of an array as first argument.

Solution is to use the array format of passing the command to fOpen, which is preferred (see https://docs.python.org/2/library/subprocess.html) and is used in other parts of this code anyway.
@jasquibb
Copy link

I ran into this issue today, and I appreciate the fix.

@mdymike
Copy link
Contributor Author

mdymike commented May 14, 2019

Hey - per that message from git I have resubmitted this pull request on gitgadget gitgitgadget#183

In the meantime, it's easy to tweak that git-p4.py file yourself on disk to fix the problem immediately

@mdymike mdymike closed this May 14, 2019
latif2 referenced this pull request May 20, 2019
The git source uses git_SHA1_Update() and friends to call into the
code that computes the hashes.  Traditionally, we used to map these
directly to underlying implementation of the SHA-1 hash (e.g.
SHA1_Update() from OpenSSL or blk_SHA1_Update() from block-sha1/).

This arrangement however makes it hard to tweak behaviour of the
underlying implementation without fully replacing.  If we want to
introduce a tweaked_SHA1_Update() wrapper to implement the "Update"
in a slightly different way, for example, the implementation of the
wrapper still would want to call into the underlying implementation,
but tweaked_SHA1_Update() cannot call git_SHA1_Update() to get to
the underlying implementation (often but not always SHA1_Update()).

Add another level of indirection that maps platform_SHA1_Update()
and friends to their underlying implementations, and by default make
git_SHA1_Update() and friends map to platform_SHA1_* functions.

Doing it this way will later allow us to map git_SHA1_Update() to
tweaked_SHA1_Update(), and the latter can use platform_SHA1_Update()
in its implementation.

Signed-off-by: Atousa Pahlevan Duprat <apahlevan@ieee.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.