joseluisq/gitnow

Add support for ignoring file changes temporary

joseluisq opened this issue · 0 comments

Ignoring files temporary is a useful feature when we need to quickly hide changes in a file(s) for awhile.

Using git update-index --[no-]assume-unchanged we can achieve this.

Proposal: I suggest to add an assume command in order to perform this.
The idea comes from this link.

  1. Ignoring files: Ignoring two files which contain changes (--assume-unchanged):
~> assume Cargo.toml README.md
# then `state` command should show us a clean working tree
~> state
Current working tree status:
## develop

Behind the scenes:

~> git update-index --assume-unchanged Cargo.toml README.md
  1. Revert ignored files: Reverting ignored files above via --no flag (--no-assume-unchanged):
~> assume --no Cargo.toml README.md
# then `state` command should show us changes in working directory
~> state
Current working tree status:
## master
M README.md
M Cargo.toml

Behind the scenes:

~> git update-index --no-assume-unchanged Cargo.toml README.md