Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
johanliu mannequin opened this issue May 20, 2017 · 6 comments
Closed

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

johanliu mannequin opened this issue May 20, 2017 · 6 comments
Labels
3.7 (EOL) end of life 3.8 only security fixes build The build process and cross-build

Comments

@johanliu
Copy link
Mannequin

johanliu mannequin commented May 20, 2017

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']

    @johanliu
    Copy link
    Mannequin Author

    johanliu mannequin commented May 20, 2017

    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>]

    @johanliu johanliu mannequin added the 3.7 (EOL) end of life label May 20, 2017
    @zhangyangyu
    Copy link
    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.

    @zhangyangyu zhangyangyu added build The build process and cross-build 3.8 only security fixes labels Jun 20, 2018
    @ned-deily
    Copy link
    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.

    @zhangyangyu
    Copy link
    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

    @miss-islington
    Copy link
    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

    @zhangyangyu
    Copy link
    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

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.7 (EOL) end of life 3.8 only security fixes build The build process and cross-build
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants