Skip to content

git doesn't support "-C" args under 1.8.5 occurs in configure.ac #74596

Closed

Description

@johanliu
mannequin
BPO 30411
Nosy @ned-deily, @grimreaper, @zhangyangyu, @johanliu, @miss-islington
PRs
  • bpo-30411: git doesn't support "-C" args under 1.8.5 occurs in configure.ac #1679
  • bpo-30411: git doesn't support "-C" args under 1.8.5 occurs in configure.ac #1680
  • bpo-30411: Use --git-dir instead of -C to make git work under version below 1.8.5. #8744
  • [3.7] bpo-30411: Use --git-dir instead of -C to make git work under version below 1.8.5. (GH-8744) #8836
  • [3.6] bpo-30411: Use --git-dir instead of -C to make git work under version below 1.8.5. (GH-8744) #8837
  • [2.7] bpo-30411: Use --git-dir instead of -C to make git work under version below 1.8.5. (GH-8744)  #8838
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2018-08-20.15:19:30.543>
    created_at = <Date 2017-05-20.09:29:22.278>
    labels = ['3.8', 'build', '3.7']
    title = 'git doesn\'t support "-C" args under 1.8.5 occurs in configure.ac'
    updated_at = <Date 2018-08-20.15:19:30.542>
    user = 'https://github.com/johanliu'

    bugs.python.org fields:

    activity = <Date 2018-08-20.15:19:30.542>
    actor = 'xiang.zhang'
    assignee = 'none'
    closed = True
    closed_date = <Date 2018-08-20.15:19:30.543>
    closer = 'xiang.zhang'
    components = ['Build']
    creation = <Date 2017-05-20.09:29:22.278>
    creator = 'Yuan Liu'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 30411
    keywords = ['patch']
    message_count = 6.0
    messages = ['294021', '320032', '320290', '323790', '323792', '323794']
    nosy_count = 5.0
    nosy_names = ['ned.deily', 'eitan.adler', 'xiang.zhang', 'Yuan Liu', 'miss-islington']
    pr_nums = ['1679', '1680', '8744', '8836', '8837', '8838']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue30411'
    versions = ['Python 2.7', 'Python 3.6', 'Python 3.7', 'Python 3.8']

    Activity

    1. johanliu commented on May 20, 2017

      johanliumannequin
      MannequinAuthor

      git doesn't support "-C" args under 1.8.5 occurs in configure.ac

      as I noticed from git release notes in 1.8.5:

      • Just like "make -C <directory>", "git -C <directory> ..." tells Git
        to go there before doing anything else.

      So we should have some conditional statements in configure.ac around git checkpoint, otherwise we got error message which is :

      Unknown option: -C
      usage: git [--version] [--help] [-c name=value]
      [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
      [-p|--paginate|--no-pager] [--no-replace-objects] [--bare]
      [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
      <command> [<args>]

    2. zhangyangyu commented on Jun 20, 2018

      @zhangyangyu
      Member

      Encounter the same problem on centos7 and git version is 1.8.3. Instead of checking the version to use -C option, maybe we could just use --git-dir for the same purpose?

      --- a/configure
      +++ b/configure
      @@ -2749,9 +2749,9 @@ HAS_GIT=no-repository
       fi
       if test $HAS_GIT = found
       then
      -    GITVERSION="git -C \$(srcdir) rev-parse --short HEAD"
      -    GITTAG="git -C \$(srcdir) describe --all --always --dirty"
      -    GITBRANCH="git -C \$(srcdir) name-rev --name-only HEAD"
      +    GITVERSION="git --git-dir \$(srcdir)/.git rev-parse --short HEAD"
      +    GITTAG="git --git-dir \$(srcdir)/.git describe --all --always --dirty"
      +    GITBRANCH="git --git-dir \$(srcdir)/.git name-rev --name-only HEAD"
       else
           GITVERSION=""
           GITTAG=""
      diff --git a/configure.ac b/configure.ac
      index b13728e..278ed9f 100644
      --- a/configure.ac
      +++ b/configure.ac
      @@ -39,9 +39,9 @@ HAS_GIT=no-repository
       fi
       if test $HAS_GIT = found
       then
      -    GITVERSION="git -C \$(srcdir) rev-parse --short HEAD"
      -    GITTAG="git -C \$(srcdir) describe --all --always --dirty"
      -    GITBRANCH="git -C \$(srcdir) name-rev --name-only HEAD"
      +    GITVERSION="git --git-dir \$(srcdir)/.git rev-parse --short HEAD"
      +    GITTAG="git --git-dir \$(srcdir)/.git describe --all --always --dirty"
      +    GITBRANCH="git --git-dir \$(srcdir)/.git name-rev --name-only HEAD"
       else
           GITVERSION=""
           GITTAG=""

      This could give me the right sys._git info.

    3. ned-deily commented on Jun 22, 2018

      @ned-deily
      Member

      Thanks for the PR. I agree with Xiang Zhang that using --git-dir appears to be a better solution. See other review comments on the PR.

    4. zhangyangyu commented on Aug 20, 2018

      @zhangyangyu
      Member

      New changeset 4c85557 by Xiang Zhang in branch 'master':
      bpo-30411: Use --git-dir instead of -C to make git work under version below 1.8.5. (GH-8744)
      4c85557

    5. miss-islington commented on Aug 20, 2018

      @miss-islington
      Contributor

      New changeset 2011dd7 by Miss Islington (bot) in branch '3.7':
      bpo-30411: Use --git-dir instead of -C to make git work under version below 1.8.5. (GH-8744)
      2011dd7

    6. zhangyangyu commented on Aug 20, 2018

      @zhangyangyu
      Member

      New changeset 95f9e14 by Xiang Zhang in branch '2.7':
      [2.7] bpo-30411: Use --git-dir instead of -C to make git work under version below 1.8.5. (GH-8744) (GH-8838)
      95f9e14

    7. transferred this issue fromon Apr 10, 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

      3.7 (EOL)end of life3.8 (EOL)end of lifebuildThe build process and cross-build

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions