git-lfs/git
Taylor Blau 92d8cf18a5 git/githistory: introduce TreePreCallbackFn
To determine the paths to migrate from a repository's .gitattributes, a
caller must do the following two things in order:

  1. Read the .gitattributes file(s) in a given tree contained within
  the repository.

  2. Rewrite blobs according to the attributes applied to their paths
  via the .gitattributes file(s) read in (1).

The framework for accomplishing the task necessary in (1) was written in
the previous commit. This commit introduces the rest of that mechanism
for (1).

Because a Git object's SHA-1 signature depends on its children, we must
visit the object graph in a topological ordering. This is not sufficient
for our purposes, since the patterns in a .gitattributes file cascade
downwards.

In other words, while we have to migrate from the leaves of the tree to
its root, we have to read the .gitattributes file(s) from root to
leaves.

To accomplish this, we introduce a new callback function in the
*githistory.RewriteOptions structure, TreePreCallbackFn, which is called
once as soon as a tree is opened for the first time, and before any
blobs or sub-trees are rewritten.

This provides the optimal time to inspect the repository's contents for
interesting .gitattributes files before migrating the blobs within.

We will use this new callback function in the following commit in order
to do precisely the task as described above.
2018-07-06 14:42:48 -05:00
..
gitattr git/gitattr: introduce package 'gitattr' 2018-07-06 14:42:48 -05:00
githistory git/githistory: introduce TreePreCallbackFn 2018-07-06 14:42:48 -05:00
attribs.go git/attribs.go: consider system attribute paths 2018-06-18 19:43:03 -05:00
config.go git: remove static Config, keep Version() static 2017-10-25 20:23:43 -06:00
filter_process_scanner_test.go Merge pull request #2471 from git-lfs/git-pl-write-list 2017-08-04 09:10:28 -06:00
filter_process_scanner.go git: remove low value debug message 2017-10-27 09:51:45 -06:00
filter_process_status.go git: introduce type 'FilterProcessStatus' 2017-08-24 18:28:50 -04:00
git_test.go git: qualify struct members during initialization 2017-12-14 21:06:23 -05:00
git.go git/git.go: pass --multiple to git-fetch(1) when appropriate 2018-06-13 14:07:19 -05:00
object_scanner.go git: use wrapper functions to call Git with Git LFS disabled 2017-08-21 13:37:48 +02:00
pkt_line_reader_test.go filter-process: fix reading 1024 byte files 2016-11-22 12:21:48 +01:00
pkt_line_reader.go git: remove extraneous length check 2016-11-22 10:57:18 -07:00
pkt_line_test.go git/pl: flush underlying *bufio.Writer only when necessary 2016-11-15 14:35:21 -07:00
pkt_line_writer_test.go git: teach *PktlineWriter.Flush() to respond to nil receiver 2017-08-02 13:26:38 -06:00
pkt_line_writer.go git: teach *PktlineWriter.Flush() to respond to nil receiver 2017-08-02 13:26:38 -06:00
pkt_line.go git/pl: document pkt-line behavior 2016-11-15 14:35:21 -07:00
refs_test.go git: port over existing commands.refUpdate tests 2018-01-05 15:18:17 -07:00
refs.go git: remove unnecessary debug trace messages 2018-01-17 11:06:23 -07:00
rev_list_scanner_test.go git: prefer sending revisions over STDIN than arguments 2017-11-17 09:41:19 -08:00
rev_list_scanner.go git: prefer sending revisions over STDIN than arguments 2017-11-17 09:41:19 -08:00
version.go git: remove static Config, keep Version() static 2017-10-25 20:23:43 -06:00