[PATCH v1 2/2] convert: add alias support for 'working-tree-encoding' attributes

2018-07-08 Thread larsxschneider
From: Lars Schneider In 107642fe26 ("convert: add 'working-tree-encoding' attribute", 2018-04-15) we added an attribute which defines the working tree encoding of a file. Some platforms might spell the name of a certain encoding differently or some users might want to use different encodings on

[PATCH v1 1/2] convert: refactor conversion driver config parsing

2018-07-08 Thread larsxschneider
From: Lars Schneider Refactor conversion driver config parsing to ease the parsing of new configs in a subsequent patch. No functional change intended. Signed-off-by: Lars Schneider --- convert.c | 64 +++ 1 file changed, 32 insertions(+), 3

[PATCH v1 0/2] convert: add alias support for 'working-tree-encoding' attributes

2018-07-08 Thread larsxschneider
e first patch is a refactoring with no functional change intended. The second patch is the actual change. Thanks, Lars [1] https://public-inbox.org/git/of5d40fe06.c18cd7cd-on002582b9.002b7a02-002582b9.002b7...@notes.na.collabserv.com/ Base Ref: master Web-Diff: https://github.com/larsxschneider/

[PATCH v1] travis-ci: fix "skip_branch_tip_with_tag()" string comparison

2017-09-21 Thread larsxschneider
sion: https://public-inbox.org/git/3b175d35-5b1c-43cd-a7e9-85693335b...@gmail.com/ Sorry that this trivial fix took so long. Cheers, Lars Notes: Base Commit: a81423d7cf (a81423d7cfdc57238783f053941064c99165) Diff on Web: https://github.com/larsxschneider/git/commit/6b532a42f0 Ch

[PATCH v1 1/2] travis-ci: move Travis CI code into dedicated scripts

2017-09-10 Thread larsxschneider
From: Lars Schneider Most of the Travis CI commands are in the '.travis.yml'. The yml format does not support functions and therefore code duplication is necessary to run commands across all builds. To fix this, add a library for common CI functions. Move all Travis CI code into dedicated script

[PATCH v1 0/2] travis-ci: dedicated scripts + skip duplicated builds

2017-09-10 Thread larsxschneider
-Diff: https://github.com/larsxschneider/git/commit/65ab003ec9 Checkout: git fetch https://github.com/larsxschneider/git travisci/move-into-ci-v1 && git checkout 65ab003ec9 Lars Schneider (2): travis-ci: move Travis CI code into dedicated scripts travis-ci: skip a branch build if equa

[PATCH v1 2/2] travis-ci: skip a branch build if equal tag is present

2017-09-10 Thread larsxschneider
From: Lars Schneider If we push a branch and a tag pointing to the HEAD of this branch, then Travis CI would run the build twice. This wastes resources and slows the testing. Add a function to detect this situation and skip the build the branch if appropriate. Invoke this function on every build

[PATCH v1] travis-ci: fix Perforce install on macOS

2017-01-21 Thread larsxschneider
!)? Thanks, Lars Notes: Base Commit: 787f75f056 (master) Diff on Web: https://github.com/larsxschneider/git/commit/ec7106339d Checkout:git fetch https://github.com/larsxschneider/git travisci/brew-perforce-fix-v1 && git checkout ec7106339d .travis.yml | 11 ++- 1 file

[PATCH v1] convert: add "status=delayed" to filter process protocol

2017-01-08 Thread larsxschneider
iff on Web: https://github.com/larsxschneider/git/commit/ea25a1834b Checkout:git fetch https://github.com/larsxschneider/git filter-process/delay-v1 && git checkout ea25a1834b Interdiff (filter-process/delay-v0..filter-process/delay-v1): Documentation/gitattributes.txt |

[PATCH v1] git-p4: add diff/merge properties to .gitattributes for GitLFS files

2016-12-18 Thread larsxschneider
: Lars Schneider --- Notes: Base Commit: d1271bddd4 (v2.11.0) Diff on Web: https://github.com/git/git/compare/d1271bddd4...larsxschneider:e045b3d5c8 Checkout:git fetch https://github.com/larsxschneider/git git-p4/fix-lfs-attributes-v1 && git checkout e045b3d5c8 g

[PATCH v1] git-p4: fix git-p4.pathEncoding for removed files

2016-12-18 Thread larsxschneider
es: Base Commit: d1271bddd4 (v2.11.0) Diff on Web: https://github.com/git/git/compare/d1271bddd4...larsxschneider:05a82caa69 Checkout:git fetch https://github.com/larsxschneider/git git-p4/fix-path-encoding-v1 && git checkout 05a82caa69 git-p4.py | 19

[PATCH v1] t0021: fix flaky test

2016-12-18 Thread larsxschneider
Schneider --- Notes: Base Commit: f8bf8f2a7b (next) Diff on Web: https://github.com/git/git/compare/f8bf8f2a7b...larsxschneider:9d88b66e03 Checkout:git fetch https://github.com/larsxschneider/git filter-process/fix-flaky-test-v1 && git checkout 9d88b66e03 t/t0021-conversion

[PATCH v1] git-p4: fix empty file processing for large file system backend GitLFS

2016-12-04 Thread larsxschneider
Checkout: git fetch https://github.com/larsxschneider/git git-p4/empty-files-v1 && git checkout b717fde git-p4.py | 29 + t/t9824-git-p4-git-lfs.sh | 2 ++ 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/git-p4.py b/

[PATCH v1] git-p4: add config to retry p4 commands; retry 3 times by default

2016-12-04 Thread larsxschneider
then set the default retry count to 3. [1] https://www.perforce.com/perforce/doc.current/manuals/cmdref/global.options.html Signed-off-by: Lars Schneider --- Notes: Base Commit: 454cb6b (v2.11.0) Diff on Web: https://github.com/git/git/compare/454cb6b...larsxschneider:654c727

[PATCH v1] travis-ci: update P4 to 16.2 and GitLFS to 1.5.2 in Linux build

2016-12-04 Thread larsxschneider
/larsxschneider/git travisci/dep-update-v1 && git checkout 421365c .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0b2ea5c3e2..3843967a69 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,8 +27,8 @@ env: # The Lin

[PATCH v1] t0021: minor filter process test cleanup

2016-12-04 Thread larsxschneider
etch https://github.com/larsxschneider/git filter-process/cleanup-test-v1 && git checkout c052a3d t/t0021-conversion.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/t/t0021-conversion.sh b/t/t0021-conversion.sh index 4ea534e9fa..34891c4b1a 100755 --- a/t/t0021-conversio

[PATCH] docs: warn about possible '=' in clean/smudge filter process values

2016-12-03 Thread larsxschneider
From: Lars Schneider A pathname value in a clean/smudge filter process "key=value" pair can contain the '=' character (introduced in edcc858). Make the user aware of this issue in the docs, add a corresponding test case, and fix the issue in filter process value parser of the example implementati

[PATCH v2] Makefile: set NO_OPENSSL on macOS by default

2016-11-10 Thread larsxschneider
From: Lars Schneider Apple removed the OpenSSL header files in macOS 10.11 and above. OpenSSL was deprecated since macOS 10.7. Set `NO_OPENSSL` and `APPLE_COMMON_CRYPTO` to `YesPlease` as default for macOS. It is possible to override this and use OpenSSL by defining `NO_APPLE_COMMON_CRYPTO`. Si

[PATCH v2 2/2] read-cache: make sure file handles are not inherited by child processes

2016-10-24 Thread larsxschneider
From: Lars Schneider This fixes "convert: add filter..process option" (edcc8581) on Windows. Consider the case of a file that requires filtering and is present in branch A but not in branch B. If A is the current HEAD and we checkout B then the following happens: 1. ce_compare_data() opens the

[PATCH v2 0/2] Use CLOEXEC to avoid fd leaks

2016-10-24 Thread larsxschneider
From: Lars Schneider Use the CLOEXEC flag similar to 05d1ed61 to fix leaked file descriptors. This mini patch series is necessary to make the "ls/filter-process" topic work properly for Windows. Right now the topic generates test failures on Windows as reported by Dscho: http://public-inbox.org/

[PATCH v2 1/2] sha1_file: open window into packfiles with CLOEXEC

2016-10-24 Thread larsxschneider
From: Lars Schneider All processes that the Git main process spawns inherit the open file descriptors of the main process. These leaked file descriptors can cause problems. Use the CLOEXEC flag similar to 05d1ed61 to fix the leaked file descriptors. Since `git_open_noatime` does not describe the

[PATCH v1 2/2] travis-ci: disable GIT_TEST_HTTPD for macOS

2016-10-16 Thread larsxschneider
From: Lars Schneider TravisCI changed their default macOS image from 10.10 to 10.11 [1]. Unfortunately the HTTPD tests do not run out of the box using the pre-installed Apache web server anymore. Therefore we enable these tests only for Linux and disable them for macOS. [1] https://blog.travis-c

[PATCH v1 0/2] Fix default macOS build locally and on Travis CI

2016-10-16 Thread larsxschneider
From: Lars Schneider Apple removed the OpenSSL header files in macOS and therefore Git does not build out of the box on macOS anymore. See previous discussion with Torsten here: http://public-inbox.org/git/565b3036.8000...@web.de/ This mini series makes Git build out of the box on macOS, again,

[PATCH v1 1/2] config.mak.in: set NO_OPENSSL and APPLE_COMMON_CRYPTO for macOS >10.11

2016-10-16 Thread larsxschneider
From: Lars Schneider Apple removed the OpenSSL header files in macOS 10.11 and above. OpenSSL was deprecated since macOS 10.7. Set `NO_OPENSSL` and `APPLE_COMMON_CRYPTO` to `YesPlease` as default for macOS. Make it possible to override this and use OpenSSL by defining `DARWIN_OPENSSL`. Original

[PATCH v11 12/14] convert: prepare filter..process option

2016-10-16 Thread larsxschneider
From: Lars Schneider Refactor the existing 'single shot filter mechanism' and prepare the new 'long running filter mechanism'. Signed-off-by: Lars Schneider --- convert.c | 60 ++-- 1 file changed, 34 insertions(+), 26 deletions(-) diff

[PATCH v11 14/14] contrib/long-running-filter: add long running filter example

2016-10-16 Thread larsxschneider
From: Lars Schneider Add a simple pass-thru filter as example implementation for the Git filter protocol version 2. See Documentation/gitattributes.txt, section "Filter Protocol" for more info. Signed-off-by: Lars Schneider --- Documentation/gitattributes.txt| 4 +- contrib/long-runn

[PATCH v11 11/14] convert: make apply_filter() adhere to standard Git error handling

2016-10-16 Thread larsxschneider
From: Lars Schneider apply_filter() returns a boolean that tells the caller if it "did convert or did not convert". The variable `ret` was used throughout the function to track errors whereas `1` denoted success and `0` failure. This is unusual for the Git source where `0` denotes success. Renam

[PATCH v11 10/14] pkt-line: add functions to read/write flush terminated packet streams

2016-10-16 Thread larsxschneider
From: Lars Schneider write_packetized_from_fd() and write_packetized_from_buf() write a stream of packets. All content packets use the maximal packet size except for the last one. After the last content packet a `flush` control packet is written. read_packetized_to_strbuf() reads arbitrary sized

[PATCH v11 13/14] convert: add filter..process option

2016-10-16 Thread larsxschneider
From: Lars Schneider Git's clean/smudge mechanism invokes an external filter process for every single blob that is affected by a filter. If Git filters a lot of blobs then the startup time of the external filter processes can become a significant part of the overall Git execution time. In a prel

[PATCH v11 06/14] pkt-line: extract set_packet_header()

2016-10-16 Thread larsxschneider
From: Lars Schneider Extracted set_packet_header() function converts an integer to a 4 byte hex string. Make this function locally available so that other pkt-line functions could use it. Signed-off-by: Lars Schneider Signed-off-by: Junio C Hamano --- pkt-line.c | 19 +-- 1 fi

[PATCH v11 07/14] pkt-line: add packet_write_fmt_gently()

2016-10-16 Thread larsxschneider
From: Lars Schneider packet_write_fmt() would die in case of a write error even though for some callers an error would be acceptable. Add packet_write_fmt_gently() which writes a formatted pkt-line like packet_write_fmt() but does not die in case of an error. The function is used in a subsequent

[PATCH v11 09/14] pkt-line: add packet_write_gently()

2016-10-16 Thread larsxschneider
From: Lars Schneider packet_write_fmt_gently() uses format_packet() which lets the caller only send string data via "%s". That means it cannot be used for arbitrary data that may contain NULs. Add packet_write_gently() which writes arbitrary data and does not die in case of an error. The functio

[PATCH v11 08/14] pkt-line: add packet_flush_gently()

2016-10-16 Thread larsxschneider
From: Lars Schneider packet_flush() would die in case of a write error even though for some callers an error would be acceptable. Add packet_flush_gently() which writes a pkt-line flush packet like packet_flush() but does not die in case of an error. The function is used in a subsequent patch. S

[PATCH v11 03/14] run-command: move check_pipe() from write_or_die to run_command

2016-10-16 Thread larsxschneider
From: Lars Schneider Move check_pipe() to run_command and make it public. This is necessary to call the function from pkt-line in a subsequent patch. While at it, make async_exit() static to run_command.c as it is no longer used from outside. Signed-off-by: Lars Schneider Signed-off-by: Ramsay

[PATCH v11 05/14] pkt-line: rename packet_write() to packet_write_fmt()

2016-10-16 Thread larsxschneider
From: Lars Schneider packet_write() should be called packet_write_fmt() because it is a printf-like function that takes a format string as first parameter. packet_write_fmt() should be used for text strings only. Arbitrary binary data should use a new packet_write() function that is introduced i

[PATCH v11 04/14] run-command: add clean_on_exit_handler

2016-10-16 Thread larsxschneider
From: Lars Schneider Some processes might want to perform cleanup tasks before Git kills them due to the 'clean_on_exit' flag. Let's give them an interface for doing this. The feature is used in a subsequent patch. Please note, that the cleanup callback is not executed if Git dies of a signal. T

[PATCH v11 01/14] convert: quote filter names in error messages

2016-10-16 Thread larsxschneider
From: Lars Schneider Git filter driver commands with spaces (e.g. `filter.sh foo`) are hard to read in error messages. Quote them to improve the readability. Signed-off-by: Lars Schneider Signed-off-by: Junio C Hamano --- convert.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletio

[PATCH v11 02/14] convert: modernize tests

2016-10-16 Thread larsxschneider
From: Lars Schneider Use `test_config` to set the config, check that files are empty with `test_must_be_empty`, compare files with `test_cmp`, and remove spaces after ">" and "<". Please note that the "rot13" filter configured in "setup" keeps using `git config` instead of `test_config` because

[PATCH v11 00/14] Git filter protocol

2016-10-16 Thread larsxschneider
/larsxschneider/git/pull/15 Patches 1 and 2 are cleanups and not strictly necessary for the series. Patches 3 to 12 are required preparation. Patch 13 is the main patch. Patch 14 adds an example how to use the Git filter protocol in contrib. Thanks a lot to Jakub, Junio, Ramsay, Dscho, Torsten and

[PATCH v10 04/14] run-command: add clean_on_exit_handler

2016-10-08 Thread larsxschneider
From: Lars Schneider Some processes might want to perform cleanup tasks before Git kills them due to the 'clean_on_exit' flag. Let's give them an interface for doing this. The feature is used in a subsequent patch. Please note, that the cleanup callback is not executed if Git dies of a signal. T

[PATCH v10 03/14] run-command: move check_pipe() from write_or_die to run_command

2016-10-08 Thread larsxschneider
From: Lars Schneider Move check_pipe() to run_command and make it public. This is necessary to call the function from pkt-line in a subsequent patch. While at it, make async_exit() static to run_command.c as it is no longer used from outside. Signed-off-by: Lars Schneider Signed-off-by: Ramsay

[PATCH v10 09/14] pkt-line: add packet_write_gently()

2016-10-08 Thread larsxschneider
From: Lars Schneider packet_write_fmt_gently() uses format_packet() which lets the caller only send string data via "%s". That means it cannot be used for arbitrary data that may contain NULs. Add packet_write_gently() which writes arbitrary data and does not die in case of an error. The functio

[PATCH v10 05/14] pkt-line: rename packet_write() to packet_write_fmt()

2016-10-08 Thread larsxschneider
From: Lars Schneider packet_write() should be called packet_write_fmt() because it is a printf-like function that takes a format string as first parameter. packet_write_fmt() should be used for text strings only. Arbitrary binary data should use a new packet_write() function that is introduced i

[PATCH v10 08/14] pkt-line: add packet_flush_gently()

2016-10-08 Thread larsxschneider
From: Lars Schneider packet_flush() would die in case of a write error even though for some callers an error would be acceptable. Add packet_flush_gently() which writes a pkt-line flush packet like packet_flush() but does not die in case of an error. The function is used in a subsequent patch. S

[PATCH v10 07/14] pkt-line: add packet_write_fmt_gently()

2016-10-08 Thread larsxschneider
From: Lars Schneider packet_write_fmt() would die in case of a write error even though for some callers an error would be acceptable. Add packet_write_fmt_gently() which writes a formatted pkt-line like packet_write_fmt() but does not die in case of an error. The function is used in a subsequent

[PATCH v10 12/14] convert: prepare filter..process option

2016-10-08 Thread larsxschneider
From: Lars Schneider Refactor the existing 'single shot filter mechanism' and prepare the new 'long running filter mechanism'. Signed-off-by: Lars Schneider --- convert.c | 60 ++-- 1 file changed, 34 insertions(+), 26 deletions(-) diff

[PATCH v10 06/14] pkt-line: extract set_packet_header()

2016-10-08 Thread larsxschneider
From: Lars Schneider Extracted set_packet_header() function converts an integer to a 4 byte hex string. Make this function locally available so that other pkt-line functions could use it. Signed-off-by: Lars Schneider Signed-off-by: Junio C Hamano --- pkt-line.c | 19 +-- 1 fi

[PATCH v10 10/14] pkt-line: add functions to read/write flush terminated packet streams

2016-10-08 Thread larsxschneider
From: Lars Schneider write_packetized_from_fd() and write_packetized_from_buf() write a stream of packets. All content packets use the maximal packet size except for the last one. After the last content packet a `flush` control packet is written. read_packetized_to_strbuf() reads arbitrary sized

[PATCH v10 14/14] contrib/long-running-filter: add long running filter example

2016-10-08 Thread larsxschneider
From: Lars Schneider Add a simple pass-thru filter as example implementation for the Git filter protocol version 2. See Documentation/gitattributes.txt, section "Filter Protocol" for more info. Signed-off-by: Lars Schneider --- Documentation/gitattributes.txt| 4 +- contrib/long-runn

[PATCH v10 11/14] convert: make apply_filter() adhere to standard Git error handling

2016-10-08 Thread larsxschneider
From: Lars Schneider apply_filter() returns a boolean that tells the caller if it "did convert or did not convert". The variable `ret` was used throughout the function to track errors whereas `1` denoted success and `0` failure. This is unusual for the Git source where `0` denotes success. Renam

[PATCH v10 13/14] convert: add filter..process option

2016-10-08 Thread larsxschneider
From: Lars Schneider Git's clean/smudge mechanism invokes an external filter process for every single blob that is affected by a filter. If Git filters a lot of blobs then the startup time of the external filter processes can become a significant part of the overall Git execution time. In a prel

[PATCH v10 00/14] Git filter protocol

2016-10-08 Thread larsxschneider
/larsxschneider/git/pull/14 Patches 1 and 2 are cleanups and not strictly necessary for the series. Patches 3 to 12 are required preparation. Patch 13 is the main patch. Patch 14 adds an example how to use the Git filter protocol in contrib. Thanks a lot to Jakub, Junio, and Peff for very helpful

[PATCH v10 01/14] convert: quote filter names in error messages

2016-10-08 Thread larsxschneider
From: Lars Schneider Git filter driver commands with spaces (e.g. `filter.sh foo`) are hard to read in error messages. Quote them to improve the readability. Signed-off-by: Lars Schneider Signed-off-by: Junio C Hamano --- convert.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletio

[PATCH v10 02/14] convert: modernize tests

2016-10-08 Thread larsxschneider
From: Lars Schneider Use `test_config` to set the config, check that files are empty with `test_must_be_empty`, compare files with `test_cmp`, and remove spaces after ">" and "<". Please note that the "rot13" filter configured in "setup" keeps using `git config` instead of `test_config` because

[PATCH v9 03/14] run-command: move check_pipe() from write_or_die to run_command

2016-10-04 Thread larsxschneider
From: Lars Schneider Move check_pipe() to run_command and make it public. This is necessary to call the function from pkt-line in a subsequent patch. While at it, make async_exit() static to run_command.c as it is no longer used from outside. Signed-off-by: Lars Schneider Signed-off-by: Ramsay

[PATCH v9 05/14] pkt-line: rename packet_write() to packet_write_fmt()

2016-10-04 Thread larsxschneider
From: Lars Schneider packet_write() should be called packet_write_fmt() because it is a printf-like function that takes a format string as first parameter. packet_write_fmt() should be used for text strings only. Arbitrary binary data should use a new packet_write() function that is introduced i

[PATCH v9 04/14] run-command: add wait_on_exit

2016-10-04 Thread larsxschneider
From: Lars Schneider The flag 'clean_on_exit' kills child processes spawned by Git on exit. A hard kill like this might not be desired in all cases. Add 'wait_on_exit' which closes the child's stdin on Git exit and waits until the child process has terminated. The flag is used in a subsequent p

[PATCH v9 14/14] contrib/long-running-filter: add long running filter example

2016-10-04 Thread larsxschneider
From: Lars Schneider Add a simple pass-thru filter as example implementation for the Git filter protocol version 2. See Documentation/gitattributes.txt, section "Filter Protocol" for more info. Signed-off-by: Lars Schneider --- Documentation/gitattributes.txt| 4 +- contrib/long-runn

[PATCH v9 10/14] pkt-line: add functions to read/write flush terminated packet streams

2016-10-04 Thread larsxschneider
From: Lars Schneider write_packetized_from_fd() and write_packetized_from_buf() write a stream of packets. All content packets use the maximal packet size except for the last one. After the last content packet a `flush` control packet is written. read_packetized_to_strbuf() reads arbitrary sized

[PATCH v9 11/14] convert: make apply_filter() adhere to standard Git error handling

2016-10-04 Thread larsxschneider
From: Lars Schneider apply_filter() returns a boolean that tells the caller if it "did convert or did not convert". The variable `ret` was used throughout the function to track errors whereas `1` denoted success and `0` failure. This is unusual for the Git source where `0` denotes success. Renam

[PATCH v9 08/14] pkt-line: add packet_flush_gently()

2016-10-04 Thread larsxschneider
From: Lars Schneider packet_flush() would die in case of a write error even though for some callers an error would be acceptable. Add packet_flush_gently() which writes a pkt-line flush packet like packet_flush() but does not die in case of an error. The function is used in a subsequent patch. S

[PATCH v9 00/14] Git filter protocol

2016-10-04 Thread larsxschneider
/larsxschneider/git/pull/13 Patches 1 and 2 are cleanups and not strictly necessary for the series. Patches 3 to 12 are required preparation. Patch 13 is the main patch. Patch 14 adds an example how to use the Git filter protocol in contrib. Thanks a lot to Ramsay, Jakub, Junio, Johannes, Torsten

[PATCH v9 12/14] convert: prepare filter..process option

2016-10-04 Thread larsxschneider
From: Lars Schneider Refactor the existing 'single shot filter mechanism' and prepare the new 'long running filter mechanism'. Signed-off-by: Lars Schneider --- convert.c | 60 ++-- 1 file changed, 34 insertions(+), 26 deletions(-) diff

[PATCH v9 01/14] convert: quote filter names in error messages

2016-10-04 Thread larsxschneider
From: Lars Schneider Git filter driver commands with spaces (e.g. `filter.sh foo`) are hard to read in error messages. Quote them to improve the readability. Signed-off-by: Lars Schneider Signed-off-by: Junio C Hamano --- convert.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletio

[PATCH v9 09/14] pkt-line: add packet_write_gently()

2016-10-04 Thread larsxschneider
From: Lars Schneider packet_write_fmt_gently() uses format_packet() which lets the caller only send string data via "%s". That means it cannot be used for arbitrary data that may contain NULs. Add packet_write_gently() which writes arbitrary data and does not die in case of an error. The functio

[PATCH v9 07/14] pkt-line: add packet_write_fmt_gently()

2016-10-04 Thread larsxschneider
From: Lars Schneider packet_write_fmt() would die in case of a write error even though for some callers an error would be acceptable. Add packet_write_fmt_gently() which writes a formatted pkt-line like packet_write_fmt() but does not die in case of an error. The function is used in a subsequent

[PATCH v9 06/14] pkt-line: extract set_packet_header()

2016-10-04 Thread larsxschneider
From: Lars Schneider Extracted set_packet_header() function converts an integer to a 4 byte hex string. Make this function locally available so that other pkt-line functions could use it. Signed-off-by: Lars Schneider Signed-off-by: Junio C Hamano --- pkt-line.c | 19 +-- 1 fi

[PATCH v9 02/14] convert: modernize tests

2016-10-04 Thread larsxschneider
From: Lars Schneider Use `test_config` to set the config, check that files are empty with `test_must_be_empty`, compare files with `test_cmp`, and remove spaces after ">" and "<". Please note that the "rot13" filter configured in "setup" keeps using `git config` instead of `test_config` because

[PATCH v9 13/14] convert: add filter..process option

2016-10-04 Thread larsxschneider
From: Lars Schneider Git's clean/smudge mechanism invokes an external filter process for every single blob that is affected by a filter. If Git filters a lot of blobs then the startup time of the external filter processes can become a significant part of the overall Git execution time. In a prel

[PATCH v1] travis-ci: ask homebrew for the its path instead of hardcoding it

2016-09-21 Thread larsxschneider
From: Lars Schneider The TravisCI macOS build is broken because homebrew (a macOS depedency manager) changed its internal directory structure [1]. This is a problem because we modify the Perforce dependencies in the homebrew repository before installing them. Fix it by asking homebrew for its pa

[PATCH v8 05/11] pkt-line: add packet_flush_gently()

2016-09-20 Thread larsxschneider
From: Lars Schneider packet_flush() would die in case of a write error even though for some callers an error would be acceptable. Add packet_flush_gently() which writes a pkt-line flush packet like packet_flush() but does not die in case of an error. The function is used in a subsequent patch. S

[PATCH v8 07/11] pkt-line: add functions to read/write flush terminated packet streams

2016-09-20 Thread larsxschneider
From: Lars Schneider write_packetized_from_fd() and write_packetized_from_buf() write a stream of packets. All content packets use the maximal packet size except for the last one. After the last content packet a `flush` control packet is written. read_packetized_to_buf() reads arbitrary sized pa

[PATCH v8 08/11] convert: quote filter names in error messages

2016-09-20 Thread larsxschneider
From: Lars Schneider Git filter driver commands with spaces (e.g. `filter.sh foo`) are hard to read in error messages. Quote them to improve the readability. Signed-off-by: Lars Schneider --- convert.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/convert.c b

[PATCH v8 09/11] convert: modernize tests

2016-09-20 Thread larsxschneider
From: Lars Schneider Use `test_config` to set the config, check that files are empty with `test_must_be_empty`, compare files with `test_cmp`, and remove spaces after ">" and "<". Please note that the "rot13" filter configured in "setup" keeps using `git config` instead of `test_config` because

[PATCH v8 11/11] convert: add filter..process option

2016-09-20 Thread larsxschneider
From: Lars Schneider Git's clean/smudge mechanism invokes an external filter process for every single blob that is affected by a filter. If Git filters a lot of blobs then the startup time of the external filter processes can become a significant part of the overall Git execution time. In a prel

[PATCH v8 10/11] convert: make apply_filter() adhere to standard Git error handling

2016-09-20 Thread larsxschneider
From: Lars Schneider apply_filter() returns a boolean that tells the caller if it "did convert or did not convert". The variable `ret` was used throughout the function to track errors whereas `1` denoted success and `0` failure. This is unusual for the Git source where `0` denotes success. Renam

[PATCH v8 06/11] pkt-line: add packet_write_gently()

2016-09-20 Thread larsxschneider
From: Lars Schneider packet_write_fmt_gently() uses format_packet() which lets the caller only send string data via "%s". That means it cannot be used for arbitrary data that may contain NULs. Add packet_write_gently() which writes arbitrary data and does not die in case of an error. The functio

[PATCH v8 04/11] pkt-line: add packet_write_fmt_gently()

2016-09-20 Thread larsxschneider
From: Lars Schneider packet_write_fmt() would die in case of a write error even though for some callers an error would be acceptable. Add packet_write_fmt_gently() which writes a formatted pkt-line like packet_write_fmt() but does not die in case of an error. The function is used in a subsequent

[PATCH v8 00/11] Git filter protocol

2016-09-20 Thread larsxschneider
/larsxschneider/git/pull/12 Thanks a lot to Stefan, Torsten, Junio, Jeff, and Ramsay for very helpful reviews, Lars ## Major changes since v7 * explicitly define all packets as text packets terminated by an LF (except CONTENT and flush) * move check_pipe() from write_or_die to run_command and

[PATCH v8 02/11] pkt-line: extract set_packet_header()

2016-09-20 Thread larsxschneider
From: Lars Schneider set_packet_header() converts an integer to a 4 byte hex string. Make this function locally available so that other pkt-line functions can use it. Signed-off-by: Lars Schneider --- pkt-line.c | 19 +-- 1 file changed, 13 insertions(+), 6 deletions(-) diff -

[PATCH v8 01/11] pkt-line: rename packet_write() to packet_write_fmt()

2016-09-20 Thread larsxschneider
From: Lars Schneider packet_write() should be called packet_write_fmt() as the string parameter can be formatted. Suggested-by: Junio C Hamano Signed-off-by: Lars Schneider --- builtin/archive.c| 4 ++-- builtin/receive-pack.c | 4 ++-- builtin/remote-ext.c | 4 ++-- builtin/

[PATCH v8 03/11] run-command: move check_pipe() from write_or_die to run_command

2016-09-20 Thread larsxschneider
From: Lars Schneider Move check_pipe() to run_command and make it public. This is necessary to call the function from pkt-line in a subsequent patch. Signed-off-by: Lars Schneider --- run-command.c | 13 + run-command.h | 2 ++ write_or_die.c | 13 - 3 files changed,

[PATCH v7 10/10] convert: add filter..process option

2016-09-08 Thread larsxschneider
From: Lars Schneider Git's clean/smudge mechanism invokes an external filter process for every single blob that is affected by a filter. If Git filters a lot of blobs then the startup time of the external filter processes can become a significant part of the overall Git execution time. In a prel

[PATCH v7 09/10] convert: make apply_filter() adhere to standard Git error handling

2016-09-08 Thread larsxschneider
From: Lars Schneider apply_filter() returns a boolean that tells the caller if it "did convert or did not convert". The variable `ret` was used throughout the function to track errors whereas `1` denoted success and `0` failure. This is unusual for the Git source where `0` denotes success. Renam

[PATCH v7 04/10] pkt-line: add packet_flush_gently()

2016-09-08 Thread larsxschneider
From: Lars Schneider packet_flush() would die in case of a write error even though for some callers an error would be acceptable. Add packet_flush_gently() which writes a pkt-line flush packet and returns `0` for success and `-1` for failure. Signed-off-by: Lars Schneider --- pkt-line.c | 9 ++

[PATCH v7 07/10] convert: quote filter names in error messages

2016-09-08 Thread larsxschneider
From: Lars Schneider Git filter driver commands with spaces (e.g. `filter.sh foo`) are hard to read in error messages. Quote them to improve the readability. Signed-off-by: Lars Schneider --- convert.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/convert.c b

[PATCH v7 05/10] pkt-line: add packet_write_gently()

2016-09-08 Thread larsxschneider
From: Lars Schneider packet_write_fmt_gently() uses format_packet() which lets the caller only send string data via "%s". That means it cannot be used for arbitrary data that may contain NULs. Add packet_write_gently() which writes arbitrary data and returns `0` for success and `-1` for an error

[PATCH v7 08/10] convert: modernize tests

2016-09-08 Thread larsxschneider
From: Lars Schneider Use `test_config` to set the config, check that files are empty with `test_must_be_empty`, compare files with `test_cmp`, and remove spaces after ">" and "<". Please note that the "rot13" filter configured in "setup" keeps using `git config` instead of `test_config` because

[PATCH v7 06/10] pkt-line: add functions to read/write flush terminated packet streams

2016-09-08 Thread larsxschneider
From: Lars Schneider write_packetized_from_fd() and write_packetized_from_buf() write a stream of packets. All content packets use the maximal packet size except for the last one. After the last content packet a `flush` control packet is written. read_packetized_to_buf() reads arbitrary sized pa

[PATCH v7 02/10] pkt-line: extract set_packet_header()

2016-09-08 Thread larsxschneider
From: Lars Schneider set_packet_header() converts an integer to a 4 byte hex string. Make this function locally available so that other pkt-line functions can use it. Signed-off-by: Lars Schneider --- pkt-line.c | 19 +-- 1 file changed, 13 insertions(+), 6 deletions(-) diff -

[PATCH v7 01/10] pkt-line: rename packet_write() to packet_write_fmt()

2016-09-08 Thread larsxschneider
From: Lars Schneider packet_write() should be called packet_write_fmt() as the string parameter can be formatted. Suggested-by: Junio C Hamano Signed-off-by: Lars Schneider --- builtin/archive.c| 4 ++-- builtin/receive-pack.c | 4 ++-- builtin/remote-ext.c | 4 ++-- builtin/

[PATCH v7 03/10] pkt-line: add packet_write_fmt_gently()

2016-09-08 Thread larsxschneider
From: Lars Schneider packet_write_fmt() would die in case of a write error even though for some callers an error would be acceptable. Add packet_write_fmt_gently() which writes a formatted pkt-line and returns `0` for success and `-1` for an error. Signed-off-by: Lars Schneider --- pkt-line.c

[PATCH v7 00/10] Git filter protocol

2016-09-08 Thread larsxschneider
/larsxschneider/git/pull/11 Thanks a lot to Stefan, Junio, Jakub (Narebski and Keller), Peff, and Torsten for very helpful reviews, Lars ## Major changes since v6 * series rebased to Git v2.10.0 * simplified and improved multi-packet test * v2 filter takes precedence over v1 filter * rename

[PATCH v1 2/2] read-cache: make sure file handles are not inherited by child processes

2016-09-05 Thread larsxschneider
From: Lars Schneider This fix prepares a series with the goal to avoid launching a new clean/smudge filter process for each file that is filtered. A new long running filter process is introduced that is used to filter all files in a single Git invocation. Consider the case of a file that require

[PATCH v1 0/2] Use CLOEXEC to avoid fd leaks

2016-09-05 Thread larsxschneider
From: Lars Schneider Use the CLOEXEC flag similar to 05d1ed61 to fix leaked file descriptors. Patch 1/2 was contemplated by Junio here: http://public-inbox.org/git/xmqq37lnbbpk@gitster.mtv.corp.google.com/ I followed Torsten's advice and renamed `git_open_noatime` to `git_open_noatime_cloex

[PATCH v1 1/2] sha1_file: open window into packfiles with CLOEXEC

2016-09-05 Thread larsxschneider
From: Lars Schneider All processes that the Git main process spawns inherit the open file descriptors of the main process. These leaked file descriptors can cause problems. Use the CLOEXEC flag similar to 05d1ed61 to fix the leaked file descriptors. Signed-off-by: Lars Schneider --- builtin/p

[PATCH v1] pack-protocol: fix maximum pkt-line size

2016-08-29 Thread larsxschneider
From: Lars Schneider According to LARGE_PACKET_MAX in pkt-line.h the maximal length of a pkt-line packet is 65520 bytes. The pkt-line header takes 4 bytes and therefore the pkt-line data component must not exceed 65516 bytes. Signed-off-by: Lars Schneider --- This patch was part of my "Git fil

[PATCH v6 07/13] pack-protocol: fix maximum pkt-line size

2016-08-25 Thread larsxschneider
From: Lars Schneider According to LARGE_PACKET_MAX in pkt-line.h the maximal length of a pkt-line packet is 65520 bytes. The pkt-line header takes 4 bytes and therefore the pkt-line data component must not exceed 65516 bytes. Signed-off-by: Lars Schneider --- Documentation/technical/protocol-c

[PATCH v6 04/13] pkt-line: add packet_flush_gently()

2016-08-25 Thread larsxschneider
From: Lars Schneider packet_flush() would die in case of a write error even though for some callers an error would be acceptable. Add packet_flush_gently() which writes a pkt-line flush packet and returns `0` for success and `-1` for failure. Signed-off-by: Lars Schneider --- pkt-line.c | 6 ++

[PATCH v6 08/13] convert: quote filter names in error messages

2016-08-25 Thread larsxschneider
From: Lars Schneider Git filter driver commands with spaces (e.g. `filter.sh foo`) are hard to read in error messages. Quote them to improve the readability. Signed-off-by: Lars Schneider --- convert.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/convert.c b

  1   2   3   4   >