Re: [PATCH v2 01/25] api-lockfile: expand the documentation

2014-04-07 Thread Jeff King
On Mon, Apr 07, 2014 at 01:33:43AM +0200, Michael Haggerty wrote:

 +unable_to_lock_error::
 +
 + Emit an error describing that there was an error locking the
 + specified path.  The err parameter should be the errno of the
 + problem that caused the failure.
 +
 +unable_to_lock_die::
 +
 + Like `unable_to_lock_error()`, but also `die()`.

The die() function is still called unable_to_lock_index_die() at this
point in the series.  Presumably you change it later. I don't know if it
is worth caring about the order or not; it's a doc change, so it's not
like it breaks bisectability.

-Peff
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 01/25] api-lockfile: expand the documentation

2014-04-06 Thread Michael Haggerty
Document a couple more functions and the flags argument as used by
hold_lock_file_for_update() and hold_lock_file_for_append().

Signed-off-by: Michael Haggerty mhag...@alum.mit.edu
---
 Documentation/technical/api-lockfile.txt | 36 +---
 1 file changed, 33 insertions(+), 3 deletions(-)

diff --git a/Documentation/technical/api-lockfile.txt 
b/Documentation/technical/api-lockfile.txt
index dd89404..b53e300 100644
--- a/Documentation/technical/api-lockfile.txt
+++ b/Documentation/technical/api-lockfile.txt
@@ -28,9 +28,39 @@ hold_lock_file_for_update::
the final destination (e.g. `$GIT_DIR/index`) and a flag
`die_on_error`.  Attempt to create a lockfile for the
destination and return the file descriptor for writing
-   to the file.  If `die_on_error` flag is true, it dies if
-   a lock is already taken for the file; otherwise it
-   returns a negative integer to the caller on failure.
+   to the file.  The flags parameter is a combination of
++
+--
+LOCK_NODEREF::
+
+   Usually symbolic links in path are resolved in path and the
+   lockfile is created by adding .lock to the resolved path;
+   however, if `LOCK_NODEREF` is set, then the lockfile is
+   created by adding .lock to the path argument itself.
+
+LOCK_DIE_ON_ERROR::
+
+   If a lock is already taken for the file, `die()` with an error
+   message.  If this option is not specified, return a negative
+   integer to the caller on failure.
+--
+
+hold_lock_file_for_append::
+
+   Like `hold_lock_file_for_update()`, except that additionally
+   the existing contents of the file (if any) are copied to the
+   lockfile and its write pointer is positioned at the end of the
+   file before returning.
+
+unable_to_lock_error::
+
+   Emit an error describing that there was an error locking the
+   specified path.  The err parameter should be the errno of the
+   problem that caused the failure.
+
+unable_to_lock_die::
+
+   Like `unable_to_lock_error()`, but also `die()`.
 
 commit_lock_file::
 
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html