Skip to content

git clone/checkout fails when using commit sha1 as tag #106

Closed

Description

@adangel

Currently we need to fork Schedul-o-matic-9000 and fflib-apex-common in order to create a tag, that we can use in project-list.xml:

  <project>
    <name>Schedul-o-matic-9000</name>
    <type>git</type>
    <connection>https://github.com/pmd/Schedul-o-matic-9000</connection>
    <!-- 
    <connection>https://github.com/SalesforceLabs/Schedul-o-matic-9000</connection>
    Note: using forked repo from pmd, as original repo doesn't have any useful tags/branches
    -->
    <tag>pmd-regression-test</tag>
  </project>

It would be nice to allow to specify directly a sha1 for the commit, e.g.

  <project>
    <name>Schedul-o-matic-9000</name>
    <type>git</type>
    <connection>https://github.com/SalesforceLabs/Schedul-o-matic-9000</connection>
    <tag>6b1229ba43b38931fbbab5924bc9b9611d19a786</tag>
  </project>

Using the tag-tag would avoid to change the schema for this file.

Activity

  1. added
    enhancement
    on Apr 12, 2022
  2. changed the title [-]Allow to specify commits in project-list[/-] [+]Allow to specify commit in project-list[/+] on Apr 12, 2022
  3. adangel commented on May 5, 2022

    @adangel
    MemberAuthor

    Hm... this does already work. At least in the integration test.

  4. added
    wontfix
    on May 5, 2022
  5. added a commit that references this issue on May 5, 2022
  6. adangel commented on May 5, 2022

    @adangel
    MemberAuthor
    $ git status
    HEAD detached at 6b1229b
    nothing to commit, working tree clean
    

    All pmd-regression-tester does, is executing: git checkout 6b1229ba43b38931fbbab5924bc9b9611d19a786 && git reset --hard 6b1229ba43b38931fbbab5924bc9b9611d19a786:

    reset_cmd = "git checkout #{tag}; git reset --hard #{tag}"

    And that works fine. Git checks out in detached mode.

  7. reopened this on May 9, 2022
  8. adangel commented on May 12, 2022

    @adangel
    MemberAuthor

    Ok, so it works for https://github.com/SalesforceLabs/Schedul-o-matic-9000 because "6b1229ba43b38931fbbab5924bc9b9611d19a786" is the latest commit referenced by HEAD: https://github.com/SalesforceLabs/Schedul-o-matic-9000/commits/master

    As soon as a new commit is added, it'll stop working.

    For the other repo https://github.com/apex-enterprise-patterns/fflib-apex-common we use the commit "7e0891efb86d23de62811af56d87d0959082a322", which is not the HEAD, and hence it fails:

    git clone --no-single-branch --depth 1 https://github.com/apex-enterprise-patterns/fflib-apex-common test-fflib-apex-common
    cd test-fflib-apex-common && git checkout 7e0891efb86d23de62811af56d87d0959082a322 && git reset --hard 7e0891efb86d23de62811af56d87d0959082a322 && cd ..
    fatal: reference is not a tree: 7e0891efb86d23de62811af56d87d0959082a322
    
  9. added
    bug
    and removed
    enhancement
    wontfix
    on May 12, 2022
  10. changed the title [-]Allow to specify commit in project-list[/-] [+]git clone/checkout fails when using commit sha1 as tag[/+] on May 12, 2022
  11. added this to the 1.5.1 milestone on May 12, 2022
  12. added a commit that references this issue on May 12, 2022
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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions