class_docstr: Helps to build releases through scripting of steps.
class_docstr_tok: ["Helps","to","build","releases","through","scripting","of","steps","."]
docstr: Commits file to repo if file has changed.
  
  Args:
    file: Relative path to the file to commit.
    msg: Message to put in the commit.
  
  Returns:
    True if commit takes place or false if no change.
docstr_tok: ["Commits","file","to","repo","if","file","has","changed",".","Args",":","file",":","Relative","path","to","the","file","to","commit",".","msg",":","Message","to","put","in","the","commit",".","Returns",":","True","if","commit","takes","place","or","false","if","no","change","."]
code: def _commit_file(self, file, msg):
      """Commits file to repo if file has changed.
  
      Args:
        file: Relative path to the file to commit.
        msg: Message to put in the commit.
  
      Returns:
        True if commit takes place or false if no change.
      """
      file_paths = [os.path.join(self.repo.working_tree_dir, file)]
      if self.repo.index.diff(None, paths=file_paths):
          index = self.repo.index
          index.add(file_paths)
          index.commit(msg)
          logging.info("%s committed locally.", file)
          return True
      else:
          return False
  
imports: import fileinput
  import os
  from absl import app
  from absl import flags
  from absl import logging
  from git import Repo
  from git.exc import GitCommandError
  from git.exc import InvalidGitRepositoryError
label_desc: Use image node_id 5 for calling the ReleaseBuilder obj's underlying member method code with example usage: obj._commit_file(file, msg) and returns: True, False