Thread (5 messages) flat view 5 messages, 4 authors, 2016-06-15

Re: [PATCH] git-filter-branch: add --egrep-filter option

From: Jonathan Nieder <hidden>
Date: 2016-06-15 22:51:03

Hi,

Michael O'Cleirigh wrote:
After considering your comment I have to agree with you that it is a
special case of index-filter and probably not useful/general for
enough other cases to justify adding in a new command line option.
Now, why do you give up so easily? ;-)

Surely what your patch is hinting at is the possibility of an
--ls-tree-filter (for lack of a better name) that works with trees
without the overhead of unpacking them.  On the other hand I do agree
with Hannes that allowing only "egrep" is a bit overspecialized.

In practice I would have used something like

	--commit-filter='
		tree=$1 &&
		new_tree=$(
			git ls-tree $commit |
			egrep "$filter_egrep" |
			git mktree
		) &&
		shift &&
		git_commit_non_empty_tree "$new_tree" "$@"
	'

so another (simpler?) solution might be an entry for the EXAMPLES
section of the manual along these lines.

Ciao,
Jonathan
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help