Skip to content

Allow certain files to be dirty #259

@awbacker

Description

@awbacker

I am looking for a way to allow certain files to be included with the bump command, so they can be part of the versioned commit. I'm thinking of version specific generated artifacts right now, but there are probably other uses cases.

Would something like this be helpful to others?

Current process

The goal is to get a single commit with all files, with the correct subject. That subject is used to trigger steps in the build.

  1. bump version
  2. python gen-summary.py > docs/summary.md
  3. git add docs/summary.md
  4. git commit --amend --no-edit
  5. push

It would be nice to be able to specify directories or specific files that should be included in the commit if they are dirty (or possibly ignored)?

Include these files IF they are dirty, all others are errors

$> bump2version patch \
       --include-if-dirty=docs/*.md \
       --include-if-dirty=docs/favicon.ico

Allow specific dirty files

Allow some files to be dirty if they are ADDed in git. If the modified files are not staged yet, then an error could still be thrown

$> git add docs/summary.md
$> bump2version patch --allow-modified = docs/*.md

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