Commit 92ec546
committed
feat(record): add untracked file detection
This updates `git record` and `git amend` to automaticaly detect (and
optionally add) new, untracked files.
There are 4 modes of operation, configurable via command line option and config
setting:
- `disable` (default): do nothing; don't look for untracked files on disk/in db
- `skip`: new files are not added, will remain skipped in subsequent invocaions
- `add`: new files are added to the commit
- `prompt`: user will be prompted for what to do with each new file
Notes:
- As noted above, this behavior it totally disabled by default. It must be
enabled either via CLI option, or via the config setting.
- Untracked files are considered "new" if they are detected on disk, but aren't
in the cached list from last run (ie in the db).
- Every invocation of record/amend updates a cache of "known" untracked
files, stored in our internal sqlite db.
- Because the cache is updated on every invocation, a previously skipped file
may be treated as a new file if was deleted and later recreated.
- Config setting `branchless.record.untrackedFiles` is provided to change the
default runtime behavior, ie when `--untracked` is not used
- If there are staged changes, then no untracked files are added/prompted.
- A list of "known" (previously skipped) files is printed at runtime.
Admittedly, this can be sort of annoying, but it is intended to help maintain
"situational awareness" and reduce confusion about why the feature is
behaving in a particular way. This may need to be reconsidered based on user
feedback.
- When new files are skipped, a hint is shown to remind the user that
- they will remain skipped forever
- if they need to be added, they need to do so manually, via `git add`1 parent 2ac991e commit 92ec546
File tree
13 files changed
+967
-15
lines changed- git-branchless-lib
- src
- core
- git
- git-branchless-opts/src
- git-branchless-record
- src
- tests
- git-branchless
- src/commands
- tests
13 files changed
+967
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
250 | 250 | | |
251 | 251 | | |
252 | 252 | | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
253 | 257 | | |
254 | 258 | | |
255 | 259 | | |
| |||
269 | 273 | | |
270 | 274 | | |
271 | 275 | | |
| 276 | + | |
272 | 277 | | |
273 | 278 | | |
274 | 279 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
0 commit comments