Skip to content

cannot rake_commit on initial commit #3

Open

Description

@phinze

trying to rc a first commit of a new repo yields this error:

gems/rake_commit-0.11.0/lib/shell.rb:11:in `backtick': Command failed: "git merge-base master origin/master"

Activity

  1. pgr0ss commented on Sep 26, 2011

    @pgr0ss
    Owner

    If there are no commits, then the squash fails because rc cannot find a previous commit from origin. I'm not sure how to handle this in an elegant way considering it will only happen once on new repos.

  2. phinze commented on Sep 26, 2011

    @phinze
    Author

    this will yield 0 on a new repo, and > 1 if there are commits:

    git count-objects | awk '{print $1}'
    

    it's existed in git since 2006 - so should be pretty reliably available

    https://github.com/gitster/git/blob/c74320872b445104fe5c265e60785d9d26d94cc5/builtin-count.c

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions