git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 0/2] Add --no-filters option to git-add

From
Andrej Shadura via GitGitGadget <gitgitgadget@gmail.com>
Date
Feb 19, 2021, 18:12 UTC
Message-ID
<pull.880.git.1613758333.gitgitgadget@gmail.com>

It is possible for a user to disable attribute-based filtering when committing by doing one of the following:

 * Create .git/info/attributes unapplying all possible transforming
   attributes.
 * Use git hash-object and git update-index to stage files manually.

Doing the former requires keeping an up-to-date list of all attributes which can transform files when committing or checking out. Doing the latter is difficult, error-prone and slow when done from scripts.

Instead, similarly to git hash-object, --no-filter can be added to git add to enable temporarily disabling filtering in an easy to use way.

These patches:
 * Add new flag ADD_CACHE_RAW to add_to_index()
 * Add new flag HASH_RAW to index_fd()
 * Make git hash-object use the new HASH_RAW flag for consistency
 * Add tests for the new git-add option.
Andrej Shadura (2):
  add: add option --no-filters to disable attribute-based filtering
  hash-object: use the new HASH_RAW flag instead of setting path to NULL
 Documentation/git-add.txt |  7 +++++-
 builtin/add.c             |  3 +++
 builtin/hash-object.c     | 17 ++++++---------
 cache.h                   |  2 ++
 object-file.c             |  2 +-
 read-cache.c              |  3 +++
 t/t2205-add-no-filters.sh | 46 +++++++++++++++++++++++++++++++++++++++
 7 files changed, 68 insertions(+), 12 deletions(-)
 create mode 100755 t/t2205-add-no-filters.sh
base-commit: 2283e0e9af55689215afa39c03beb2315ce18e83
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-880%2Fandrewshadura%2Fgit-add-no-filters-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-880/andrewshadura/git-add-no-filters-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/880
-- 
gitgitgadget
Next: Andrej Shadura via GitGitGadget
Message 1 of 11 in “Add --no-filters option to git-add”
  1. 0/2 Add --no-filters option to git-addAndrej Shadura via GitGitGadget, Feb 19, 2021
  2. 1/2 add: add option --no-filters to disable attribute-based filteringAndrej Shadura via GitGitGadget, Feb 19, 2021
  3. 2/2 hash-object: use the new HASH_RAW flag instead of setting path to NULLAndrej Shadura via GitGitGadget, Feb 19, 2021
  4. brian m. carlsonFeb 19, 2021
  5. Andrej ShaduraFeb 20, 2021
  6. Andrej ShaduraFeb 20, 2021
  7. brian m. carlsonFeb 20, 2021
  8. 0/2 Add --no-filters option to git-addAndrej Shadura via GitGitGadget, Feb 20, 2021
  9. 1/2 add: add option --no-filters to disable attribute-based filteringAndrej Shadura via GitGitGadget, Feb 20, 2021
  10. 2/2 hash-object: use the new HASH_RAW flag instead of setting path to NULLAndrej Shadura via GitGitGadget, Feb 20, 2021
  11. Junio C HamanoFeb 20, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.