check-attr: add support to work with tree-ish
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v7 Latest2 patches 0 repliesNew
- v62 patches 3 repliesSuperseded
- v52 patches 7 repliesSuperseded
Earlier versions · 4
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v4 | 2 patches | 5 replies | Superseded | |
| v3 | 2 patches | 16 replies | Superseded | |
| v2 | 2 patches | 5 replies | Superseded | |
| v1 | 2 patches | 14 replies | Superseded |
Changes in v7 from the cover letter
- s/read_object_file/repo_read_object_file to make it more consistent
- In attr.h define 'struct object_id' instead of including 'hash.h'
Patches in v7 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | t0003: move setup for `--all` into new blockt/ | +5 | 0 replies | |
| 2/2 | attr: add flag `--source` to work with tree-ishDocumentation/ archive.c attr.c +9 more | +151 | 0 replies |
Reviews trailers per patch
None of the 2 patches has a Reviewed-by or Acked-by.
| Patch | [email protected] |
|---|---|
| 1/2 | Co-authored-by |
| 2/2 | Co-authored-by |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v7 0/2] check-attr: add support to work with tree-ish
v1: https://lore.kernel.org/git/[email protected]/
v2: https://lore.kernel.org/git/CAOLa=ZSsFGBw3ta1jWN8cmUch2ca=zTEjp1xMA6Linafx9W53g@mail.gmail.com/T/#t
v3: https://lore.kernel.org/git/[email protected]/
v4: https://lore.kernel.org/git/[email protected]
v5: https://lore.kernel.org/git/[email protected]/
v6: https://lore.kernel.org/git/[email protected]/
Given a pathname, git-check-attr(1) will list the attributes which apply to that pathname by reading all relevant gitattributes files. Currently there is no way to specify a tree-ish to read the gitattributes from.
This is specifically useful in bare repositories wherein the gitattributes are only present in the git working tree but not available directly on the filesystem.
This series aims to add a new flag --source to git-check-attr(1) which allows us to read gitattributes from the specified tree-ish.
Changes since v6:
- s/read_object_file/repo_read_object_file to make it more consistent
- In attr.h define 'struct object_id' instead of including 'hash.h'
Range-diff against v5:
1: 6224754179 = 1: 6224754179 t0003: move setup for `--all` into new block
2: 57f5957127 ! 2: 0ca8b24589 attr: add flag `--source` to work with tree-ish
@@ attr.c: static struct attr_stack *read_attr_from_file(const char *path, unsigned
+ if (get_tree_entry(istate->repo, tree_oid, path, &oid, &mode))
+ return NULL;
+
-+ buf = read_object_file(&oid, &type, &sz);
++ buf = repo_read_object_file(istate->repo, &oid, &type, &sz);
+ if (!buf || type != OBJ_BLOB) {
+ free(buf);
+ return NULL;
@@ attr.c: void git_check_attr(struct index_state *istate,
## attr.h ##
@@
- #ifndef ATTR_H
- #define ATTR_H
+ */
+
+ struct index_state;
++struct object_id;
-+#include "hash.h"
-+
/**
- * gitattributes mechanism gives a uniform way to associate various attributes
- * to set of paths.
+ * An attribute is an opaque object that is identified by its name. Pass the
@@ attr.h: void attr_check_free(struct attr_check *check);
const char *git_attr_name(const struct git_attr *);Karthik Nayak (2):
t0003: move setup for --all into new block
attr: add flag --source to work with tree-ish
Documentation/git-check-attr.txt | 9 ++- archive.c | 2 +- attr.c | 97 +++++++++++++++++++++++--------- attr.h | 6 +- builtin/check-attr.c | 35 +++++++----- builtin/pack-objects.c | 2 +- convert.c | 2 +- ll-merge.c | 4 +- pathspec.c | 2 +- t/t0003-attributes.sh | 48 +++++++++++++++- userdiff.c | 2 +- ws.c | 2 +- 12 files changed, 156 insertions(+), 55 deletions(-)
Signature · 1 line
2.39.0