[PATCH v6 0/2] Honor .gitattributes with rebase --am
- From
brian m. carlson <sandals@crustytoothpaste.net>
- Date
- Sep 2, 2019, 22:39 UTC
- Message-ID
- <20190902223944.897504-1-sandals@crustytoothpaste.net>
- In-Reply-To
- <20190825233340.10894-1-sandals@crustytoothpaste.net>
This series makes rebase --am honor the .gitattributes file for subsequent patches when a patch changes it.
Changes from v5: * Avoid leaking memory from already parsed filter rules.
Changes from v4: * Wrap lines in apply.c. * Handle merge and conflict-marker-size attributes. * Add tests for am and am -3 in addition to rebase.
Changes from v3: * Check for both addition and removal of .gitattributes files. * Switch from "test_config" to "git config".
Changes from v2: * Rename has_path_suffix to ends_with_path_components.
Changes from v1: * Add has_path_suffix in a separate commit.
brian m. carlson (2): path: add a function to check for path suffix am: reload .gitattributes after patching it
apply.c | 11 ++++++++++ convert.c | 21 ++++++++++++++++++- convert.h | 6 ++++++ ll-merge.c | 19 +++++++++++++---- ll-merge.h | 1 + path.c | 39 +++++++++++++++++++++++++++-------- path.h | 3 +++ t/t3400-rebase.sh | 36 ++++++++++++++++++++++++++++++++ t/t4150-am.sh | 52 +++++++++++++++++++++++++++++++++++++++++++++++ 9 files changed, 174 insertions(+), 14 deletions(-)
Range-diff against v5:
1: 2077a0829e ! 1: 1573fbd82d am: reload .gitattributes after patching it
@@ convert.c: static void convert_attrs(const struct index_state *istate,
+void reset_parsed_attributes(void)
+{
++ struct convert_driver *drv, *next;
++
+ attr_check_free(check);
+ check = NULL;
+ reset_merge_attributes();
++
++ for (drv = user_convert; drv; drv = next) {
++ next = drv->next;
++ free((void *)drv->name);
++ free(drv);
++ }
++ user_convert = NULL;
++ user_convert_tail = NULL;
+}
+
int would_convert_to_git_filter_fd(const struct index_state *istate, const char *path)