Revision dbaa6bdce22914843e956e36d41d328547514342 authored by Junio C Hamano on 31 October 2016, 20:15:21 UTC, committed by Junio C Hamano on 31 October 2016, 20:15:21 UTC
The smudge/clean filter API expect an external process is spawned
to filter the contents for each path that has a filter defined.  A
new type of "process" filter API has been added to allow the first
request to run the filter for a path to spawn a single process, and
all filtering need is served by this single process for multiple
paths, reducing the process creation overhead.

* ls/filter-process:
  contrib/long-running-filter: add long running filter example
  convert: add filter.<driver>.process option
  convert: prepare filter.<driver>.process option
  convert: make apply_filter() adhere to standard Git error handling
  pkt-line: add functions to read/write flush terminated packet streams
  pkt-line: add packet_write_gently()
  pkt-line: add packet_flush_gently()
  pkt-line: add packet_write_fmt_gently()
  pkt-line: extract set_packet_header()
  pkt-line: rename packet_write() to packet_write_fmt()
  run-command: add clean_on_exit_handler
  run-command: move check_pipe() from write_or_die to run_command
  convert: modernize tests
  convert: quote filter names in error messages
2 parent s 906d690 + 0f71fa2
Raw File
convert-grafts-to-replace-refs.sh
#!/bin/sh

# You should execute this script in the repository where you
# want to convert grafts to replace refs.

GRAFTS_FILE="${GIT_DIR:-.git}/info/grafts"

. $(git --exec-path)/git-sh-setup

test -f "$GRAFTS_FILE" || die "Could not find graft file: '$GRAFTS_FILE'"

grep '^[^# ]' "$GRAFTS_FILE" |
while read definition
do
	if test -n "$definition"
	then
		echo "Converting: $definition"
		git replace --graft $definition ||
			die "Conversion failed for: $definition"
	fi
done

mv "$GRAFTS_FILE" "$GRAFTS_FILE.bak" ||
	die "Could not rename '$GRAFTS_FILE' to '$GRAFTS_FILE.bak'"

echo "Success!"
echo "All the grafts in '$GRAFTS_FILE' have been converted to replace refs!"
echo "The grafts file '$GRAFTS_FILE' has been renamed: '$GRAFTS_FILE.bak'"
back to top