Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-121947

glibc: support git worktree with patch-git

Linking RHIVOS CVEs to...Migration: Automation ...SWIFT: POC ConversionSync from "Extern...XMLWordPrintable

    • Icon: Story Story
    • Resolution: Unresolved
    • Icon: Undefined Undefined
    • None
    • None
    • glibc
    • None
    • None
    • rhel-pt-c-libs
    • 1
    • False
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • None
    • Unspecified
    • Unspecified
    • Unspecified
    • None

      Description

      The `patch-git.lua` script fails to identify the git repository when it is executed from within a `git worktree`. This prevents developers from using the script in more complex git workflows that involve worktrees.

      Steps to Reproduce

      1. Create a new git worktree from the main repository directory.
      2. {code:bash}
        git worktree add ../<worktree-name>
        # Change directory into the newly created worktree.
        # \{code:bash}
        cd ../<worktree-name>
        
      3. Execute the `patch-git.lua` script. (The exact command might vary based on usage)
      4. {code:bash}
        lua patch-git.lua changelog
        
        

      Expected Behavior

      The `patch-git.lua` script should run without errors, correctly detecting the git repository's context from within the worktree.

      Actual Behavior

      The script terminates with the following error:

      centos/glibc-c9s/patch-git.lua:500: no Git repository and no captured Git history
      

      Analysis

      The error suggests that the script's method for finding the git repository root (e.g., searching for a `.git` directory) is not compatible with how git worktrees are structured. In a worktree, `.git` is a file pointing to the main repository's git directory, rather than being a directory itself. The script needs to be updated to handle this case.

              glibc-bugzilla Platform Tools - Libraries Bot
              fberat@redhat.com Frederic Berat
              Platform Tools - Libraries Bot Platform Tools - Libraries Bot
              Martin Coufal Martin Coufal
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

                Created:
                Updated: