Skip to content

best way to do things like 'git gc' #1093

Description

@bdklahn

I've already read "Using git directly".
But using IPython object introspection, it doesn't look like something like "gc" is a method there.

The following seems to work. Is that the recommended way?

a_repo.git.execute("git gc".split())

Activity

  1. Byron commented on Dec 12, 2020

    @Byron
    Member

    IPython is unable to see what's possible as these options are generated on the fly.

    Thus invoking a_repo.git.gc() would be the idiomatic way to achieve that.

    Please feel free to keep commenting despite the issue being closed in case there is a follow up.

  2. bdklahn commented on Dec 12, 2020

    @bdklahn
    Author

    Ah.
    Thanks!
    And that, presumably, is also why IPython TAB completion didn't complete to ". . . .gc", when I tried that.

    So what might the "split=true" be in yours? I did a string split in mine, because the execute command seemed to want an iterable (like from space-separated command line arguments, I presume), rather than a string. But with a_repo.git.gc . . . there would be no additional arguments.

  3. Byron commented on Dec 13, 2020

    @Byron
    Member

    Great to hear. The argument was a mistake.

  4. reopened this on Feb 26, 2021
  5. locked and limited conversation to collaborators on Feb 26, 2021
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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions