Skip to content

Honor .gitattributes with rebase --am

brian m. carlson git 5 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v6 Latest2 patches 0 repliesNew
  2. v52 patches 4 repliesSuperseded
  3. v42 patches 10 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v32 patches5 repliesSuperseded
v22 patches9 repliesSuperseded

Changes in v6 from the cover letter

* Avoid leaking memory from already parsed filter rules.

Patches in v6 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2path: add a function to check for path suffixpath.c path.h+33 -90 replies
2/2am: reload .gitattributes after patching itapply.c convert.c convert.h +4 more+141 -50 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v6 yet.

Read the v6 thread

Cover letter [PATCH v6 0/2] Honor .gitattributes with rebase --am

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)