Skip to content

exec action not supported #62

Closed
Closed

Description

@srl295

v0.6.0 mac.

Using a step suggested by the node-core-utils nodejs/node-core-utils#237 (comment) for landing Node.js commits I ran:

$ git rebase upstream/master -i -x "git node land --amend"
Error reading file, /Users/srl/src/node/.git/rebase-merge/git-rebase-todo
Reason: Invalid action: exec
Could not execute editor

It's not a bug with git-node because I got the same result with:

$ git rebase -i b -x /bin/date
Error reading file, /tmp/foo/.git/rebase-merge/git-rebase-todo
Reason: Invalid line: exec /bin/date
Could not execute editor

man git-rebase says:

   -x <cmd>, --exec <cmd>
       Append "exec <cmd>" after each line creating a commit in the final history. <cmd> will be interpreted as one or more
       shell commands.

       You may execute several commands by either using one instance of --exec with several commands:

           git rebase -i --exec "cmd1 && cmd2 && ..."

       or by giving more than one --exec:

           git rebase -i --exec "cmd1" --exec "cmd2" --exec ...

       If --autosquash is used, "exec" lines will not be appended for the intermediate commits, and will only appear at the end
       of each squash/fixup series.

       This uses the --interactive machinery internally, but it can be run without an explicit --interactive.

Sounds like the exec action needs to be supported by the editor.

Activity

  1. MitMaro commented on Oct 24, 2018

    @MitMaro
    Owner

    Thanks for reporting this!

    exec has been on my wishlist for a while now, but it hasn't been requested until now. Eventually I would like the ability to modify the exec lines, but perhaps just allowing them would be a decent solution for now. I think the case in the linked issue from the node-core-utils would be okay then.

  2. srl295 commented on Oct 24, 2018

    @srl295
    Author

    @MitMaro Just allowing them would be fine.

    Also, this was a little hard to track down as to what was failing. Could you change the error message to:

    $0: Error reading file…

    then I'd see:

    git-interactive-rebase-tool: Error reading file…

  3. added this to the Version 0.7 milestone on Oct 26, 2018
  4. MitMaro commented on Oct 28, 2018

    @MitMaro
    Owner

    I've added basic support for the exec action in #69 . You can't modify the action, but you can re-order it. I feel like there may be a use case to have a re-order move the exec commands attached to another action, but if that's ever requested it would required something like #24 to be implemented first.

    I should be releasing version 0.7 this weekend or sometime next week.

    Thanks again for the report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions