Skip to content

Conversation

@claytonrcarter
Copy link
Collaborator

@claytonrcarter claytonrcarter commented Sep 12, 2025

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

@claytonrcarter claytonrcarter force-pushed the record-untracked branch 2 times, most recently from 4dd84c1 to 967c4e8 Compare September 12, 2025 14:22
@claytonrcarter claytonrcarter changed the title feat(record/amend): add support for detecting and adding untracked file feat(record/amend): add support for detecting and adding untracked files Sep 26, 2025
@claytonrcarter claytonrcarter force-pushed the record-untracked branch 6 times, most recently from ba6f87b to bf1abde Compare February 2, 2026 17:08
@claytonrcarter claytonrcarter marked this pull request as ready for review February 2, 2026 17:09
@claytonrcarter claytonrcarter force-pushed the record-untracked branch 8 times, most recently from feb6239 to 08ff918 Compare February 3, 2026 01:20
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`
@claytonrcarter claytonrcarter enabled auto-merge (rebase) February 3, 2026 01:27
@claytonrcarter claytonrcarter merged commit 92ec546 into arxanas:master Feb 3, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant