Closed bug report

repo push ignores .gitignore and .adomignore when it expands a directory

Colby Knox · 4d ago ·closed by Colby Knox

adom-wiki repo push does not honor .gitignore or .adomignore when it expands a directory, so repo push <ref> --files . (or any folder) uploads build outputs, logs and anything else the project ignores. pkg publish / pkg pack already honor both files.

What happens today

  • repo push expands each listed directory with walk_dir (src/commands/repo/mod.rs, about line 890). It skips only .git, node_modules, dotfiles and *.tgz.
  • pkg pack / publish go through src/core/ignore.rs (compiles .gitignore + .adomignore) in src/core/tarball.rs. Checked locally with adom-wiki 1.7.72: a throwaway package with build/ in .gitignore and secret/ in .adomignore packed without either.
  • The help text for --files says "default: everything changed", but with no --files the command stops with "nothing to push (no files matched)".

Asked

  1. Run the directory expansion in repo push through the same matcher as pkg pack (.gitignore and .adomignore, found from the directory being pushed up to the project root), keeping today's fixed skips.
  2. An explicitly named FILE still pushes even when an ignore rule matches it (naming it is a deliberate choice), maybe with an info hint.
  3. A directory that contributes nothing because every entry was ignored keeps today's "listed director(ies) contributed no files" message, now naming ignore rules as a reason.
  4. Fix the --files help text (it is required; there is no "everything changed" default), or implement that default.
  5. A test like the tarball one in src/core/tarball.rs (dist/, *.log, !keep.log) for the push expansion.

The server does no ignore filtering on pushes, so this lives in the CLI.

1 Reply

Colby Knox · 4d ago

Fixed in adom-wiki 1.7.73 (adom-wiki pkg update adom/adom-wiki-cli).

  1. repo push expands a listed directory through .gitignore and .adomignore: the current folder's, every folder down to the pushed one, and nested ones as git applies them (deeper rules win; an ignored directory is not descended). The fixed skips (.git, node_modules, dotfiles, .tgz) stay. PUSH_IGNORED names what was skipped.
  2. A file you name explicitly still pushes when a rule matches it, with an info hint (PUSH_IGNORED_FILE_NAMED). The same goes for a directory you name that is itself ignored; inside it the other rules still apply.
  3. PUSH_DIR_EMPTY now lists ignore rules as a reason, and a push left with nothing at all says every file was skipped by the ignore files instead of "no files matched".
  4. The --files help no longer claims an "everything changed" default; it says the flag is required.
  5. A test mirrors the tarball one (dist/, *.log, !keep.log, .adomignore's secret/, a nested .gitignore).

Checked on a throwaway staging page (since deleted): pushing . skipped dist/, secret/ and x.log and kept keep.log; naming x.log or dist pushed it with the hint.

Log in to reply.