GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — rev_parse does not handle <tag>^{commit} correctly · Issue #1995 · gitpython-developers/GitPython

rev_parse does not handle <tag>^{commit} correctly #1995

New issue
Copy link
New issue
Copy link
Closed
#1996
Closed
rev_parse does not handle <tag>^{commit} correctly#1995
#1996
Copy link
Labels
acknowledgedhelp wanted

Description

@flichtenheld
flichtenheld
opened on Jan 9, 2025
Issue body actions

git rev-parse <tag>^{commit} resolves to the commit that the tag points to.

repo.rev_parse("<tag>^{commit}") says ValueError: Could not accommodate requested object type 'commit', got tag

It should instead return TagObject.object (at least if that is a commit object).

Activity

  1. flichtenheld commented on Jan 9, 2025

    @flichtenheld
    flichtenheld
    on Jan 9, 2025
    ContributorAuthor
    More actions

    Re-verified that is present in the current release (3.1.44)

  2. flichtenheld commented on Jan 9, 2025

    @flichtenheld
    flichtenheld
    on Jan 9, 2025
    ContributorAuthor
    More actions

    Interestingly it tries to resolve the tag when you specify ^{blob} although it is not clear to me when this would ever work given that TagObject.object is usually a commit.

  3. flichtenheld commented on Jan 9, 2025

    @flichtenheld
    flichtenheld
    on Jan 9, 2025
    ContributorAuthor
    More actions

    Found from the test suite that <tag>^{} works. So this a usable work-around. Will prepare a patch anyway.

    Reacted by Sebastian Thiel
  4. flichtenheld
    added a commit that references this issue on Jan 9, 2025

    Repo.rev_parse: Handle <tag>^{commit} correctly

    This issue will close once commit e4f1aa7 is merged into the 'main' branch.
    e4f1aa7
  5. Byron
    added
    acknowledged
    help wanted
    on Jan 10, 2025
  6. Byron commented on Jan 10, 2025

    @Byron
    Byron
    on Jan 10, 2025
    Member
    More actions

    Thanks a lot for digging into this!

    I may also add that this implementation is definitely not according to 'spec' and probably just superficially resembles git rev-parse semantics.
    Probably it's just good enough for the common cases, which is a reason for issues around it being quite rare overall.

  7. Byron
    closed this as completedin #1996on Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    acknowledgedhelp wanted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.