summaryrefslogtreecommitdiff
path: root/vcs-svn/line_buffer.txt
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2020-08-13 15:00:17 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-08-13 18:02:15 (GMT)
commitfc47391e2478b26d33cae033f13405b6ee6af97b (patch)
tree9cebfb9d4bbbcee8feea178c17976ec28652145c /vcs-svn/line_buffer.txt
parenta006f875e2689cb7df543d5950beadb0416d305b (diff)
downloadgit-fc47391e2478b26d33cae033f13405b6ee6af97b.zip
git-fc47391e2478b26d33cae033f13405b6ee6af97b.tar.gz
git-fc47391e2478b26d33cae033f13405b6ee6af97b.tar.bz2
drop vcs-svn experiment
The code in vcs-svn was started in 2010 as an attempt to build a remote-helper for interacting with svn repositories (as opposed to git-svn). However, we never got as far as shipping a mature remote helper, and the last substantive commit was e99d012a6bc in 2012. We do have a git-remote-testsvn, and it is even installed as part of "make install". But given the name, it seems unlikely to be used by anybody (you'd have to explicitly "git clone testsvn::$url", and there have been zero mentions of that on the mailing list since 2013, and even that includes the phrase "you might need to hack a bit to get it working properly"[1]). We also ship contrib/svn-fe, which builds on the vcs-svn work. However, it does not seem to build out of the box for me, as the link step misses some required libraries for using libgit.a. Curiously, the original build breakage bisects for me to eff80a9fd9 (Allow custom "comment char", 2013-01-16), which seems unrelated. There was an attempt to fix it in da011cb0e7 (contrib/svn-fe: fix Makefile, 2014-08-28), but on my system that only switches the error message. So it seems like the result is not really usable by anybody in practice. It would be wonderful if somebody wanted to pick up the topic again, and potentially it's worth carrying around for that reason. But the flip side is that people doing tree-wide operations have to deal with this code. And you can see the list with (replace "HEAD" with this commit as appropriate): { echo "--" git diff-tree --diff-filter=D -r --name-only HEAD^ HEAD } | git log --no-merges --oneline e99d012a6bc.. --stdin which shows 58 times somebody had to deal with the code, generally due to a compile or test failure, or a tree-wide style fix or API change. Let's drop it and let anybody who wants to pick it up do so by resurrecting it from the git history. As a bonus, this also reduces the size of a stripped installation of Git from 21MB to 19MB. [1] https://lore.kernel.org/git/CALkWK0mPHzKfzFKKpZkfAus3YVC9NFYDbFnt+5JQYVKipk3bQQ@mail.gmail.com/ Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'vcs-svn/line_buffer.txt')
-rw-r--r--vcs-svn/line_buffer.txt77
1 files changed, 0 insertions, 77 deletions
diff --git a/vcs-svn/line_buffer.txt b/vcs-svn/line_buffer.txt
deleted file mode 100644
index 8e139eb..0000000
--- a/vcs-svn/line_buffer.txt
+++ /dev/null
@@ -1,77 +0,0 @@
-line_buffer API
-===============
-
-The line_buffer library provides a convenient interface for
-mostly-line-oriented input.
-
-Each line is not permitted to exceed 10000 bytes. The provided
-functions are not thread-safe or async-signal-safe, and like
-`fgets()`, they generally do not function correctly if interrupted
-by a signal without SA_RESTART set.
-
-Calling sequence
-----------------
-
-The calling program:
-
- - initializes a `struct line_buffer` to LINE_BUFFER_INIT
- - specifies a file to read with `buffer_init`
- - processes input with `buffer_read_line`, `buffer_skip_bytes`,
- and `buffer_copy_bytes`
- - closes the file with `buffer_deinit`, perhaps to start over and
- read another file.
-
-When finished, the caller can use `buffer_reset` to deallocate
-resources.
-
-Using temporary files
----------------------
-
-Temporary files provide a place to store data that should not outlive
-the calling program. A program
-
- - initializes a `struct line_buffer` to LINE_BUFFER_INIT
- - requests a temporary file with `buffer_tmpfile_init`
- - acquires an output handle by calling `buffer_tmpfile_rewind`
- - uses standard I/O functions like `fprintf` and `fwrite` to fill
- the temporary file
- - declares writing is over with `buffer_tmpfile_prepare_to_read`
- - can re-read what was written with `buffer_read_line`,
- `buffer_copy_bytes`, and so on
- - can reuse the temporary file by calling `buffer_tmpfile_rewind`
- again
- - removes the temporary file with `buffer_deinit`, perhaps to
- reuse the line_buffer for some other file.
-
-When finished, the calling program can use `buffer_reset` to deallocate
-resources.
-
-Functions
----------
-
-`buffer_init`, `buffer_fdinit`::
- Open the named file or file descriptor for input.
- buffer_init(buf, NULL) prepares to read from stdin.
- On failure, returns -1 (with errno indicating the nature
- of the failure).
-
-`buffer_deinit`::
- Stop reading from the current file (closing it unless
- it was stdin). Returns nonzero if `fclose` fails or
- the error indicator was set.
-
-`buffer_read_line`::
- Read a line and strip off the trailing newline.
- On failure or end of file, returns NULL.
-
-`buffer_copy_bytes`::
- Read `len` bytes of input and dump them to the standard output
- stream. Returns early for error or end of file.
-
-`buffer_skip_bytes`::
- Discards `len` bytes from the input stream (stopping early
- if necessary because of an error or eof). Return value is
- the number of bytes successfully read.
-
-`buffer_reset`::
- Deallocates non-static buffers.