Skip to content

tmp_squash_msg can be improved #97

@tanin47

Description

@tanin47

tmp_squash_msh seems to be hanging around if we use git reflow in other directories than root. This is due to this part of code.

    def append_to_squashed_commit_message(message = '')
      run "echo \"#{message}\" | cat - .git/SQUASH_MSG > ./tmp_squash_msg"
      run 'mv ./tmp_squash_msg .git/SQUASH_MSG'
    end

If we are not the the root directory, the relative ./git won't exist

We can change to something like:

    def append_to_squashed_commit_message(message = '')
     git_root_dir = `echo $(git rev-parse --show-toplevel)`
      run "echo \"#{message}\" | cat - #{git_root_dir}/.git/SQUASH_MSG > #{git_root_dir}/tmp_squash_msg"
      run 'mv #{git_root_dir}/tmp_squash_msg #{git_root_dir}/.git/SQUASH_MSG'
    end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions