From: Junio C Hamano <gitster@pobox.com>
To: Michael Haggerty <mhagger@alum.mit.edu>
Cc: Johannes Sixt <j6t@kdbg.org>, git@vger.kernel.org
Subject: Re: [PATCH v2 01/16] Move lockfile documentation to lockfile.h and lockfile.c
Date: Tue, 11 Aug 2015 12:27:28 -0700 [thread overview]
Message-ID: <xmqqtws5r5gf.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <c795223dcaca8e092b10673d20def4f44156ca31.1439198011.git.mhagger@alum.mit.edu> (Michael Haggerty's message of "Mon, 10 Aug 2015 11:47:36 +0200")
Michael Haggerty <mhagger@alum.mit.edu> writes:
> Rearrange/rewrite it somewhat to fit its new environment.
> ...
> diff --git a/lockfile.h b/lockfile.h
> index b4abc61..a483cc9 100644
> --- a/lockfile.h
> +++ b/lockfile.h
> @@ -4,54 +4,103 @@
> ...
> @@ -68,16 +117,51 @@ struct lock_file {
> #define LOCK_SUFFIX ".lock"
> #define LOCK_SUFFIX_LEN 5
>
> +
> +/*
> + * Flags
> + * -----
> + *
> + * The following flags can be passed to `hold_lock_file_for_update()`
> + * or `hold_lock_file_for_append()`.
> + */
> +
> +/*
> + * If a lock is already taken for the file, `die()` with an error
> + * message. If this flag is not specified, trying to lock a file that
> + * is already locked returns -1 to the caller.
> + */
> #define LOCK_DIE_ON_ERROR 1
> +
> +/*
> + * Usually symbolic links in the destination path are resolved. This
> + * means that (1) the lockfile is created by adding ".lock" to the
> + * resolved path, and (2) upon commit, the resolved path is
> + * overwritten. However, if `LOCK_NO_DEREF` is set, then the lockfile
> + * is created by adding ".lock" to the path argument itself. This
> + * option is used, for example, when detaching a symbolic reference,
> + * which for backwards-compatibility reasons, can be a symbolic link
> + * containing the name of the referred-to-reference.
> + */
> ...
Thanks. I really like the way these per-item descriptions explain
each item much better. The old documentation may have contained all
the same info, but a better organization makes a big difference.
next prev parent reply other threads:[~2015-08-11 19:27 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-10 9:47 [PATCH v2 00/16] Introduce a tempfile module Michael Haggerty
2015-08-10 9:47 ` [PATCH v2 01/16] Move lockfile documentation to lockfile.h and lockfile.c Michael Haggerty
2015-08-11 19:27 ` Junio C Hamano [this message]
2015-08-10 9:47 ` [PATCH v2 02/16] create_bundle(): duplicate file descriptor to avoid closing it twice Michael Haggerty
2015-08-10 9:47 ` [PATCH v2 03/16] lockfile: add accessors get_lock_file_fd() and get_lock_file_fp() Michael Haggerty
2015-08-11 19:29 ` Junio C Hamano
2015-08-10 9:47 ` [PATCH v2 04/16] lockfile: add accessor get_lock_file_path() Michael Haggerty
2015-08-11 19:36 ` Junio C Hamano
2015-08-10 9:47 ` [PATCH v2 05/16] commit_lock_file(): use get_locked_file_path() Michael Haggerty
2015-08-10 9:47 ` [PATCH v2 06/16] tempfile: a new module for handling temporary files Michael Haggerty
2015-08-10 9:47 ` [PATCH v2 07/16] prepare_tempfile_object(): new function, extracted from create_tempfile() Michael Haggerty
2015-08-11 19:38 ` Junio C Hamano
2015-08-10 9:47 ` [PATCH v2 08/16] tempfile: add several functions for creating temporary files Michael Haggerty
2015-08-10 9:47 ` [PATCH v2 09/16] register_tempfile(): new function to handle an existing temporary file Michael Haggerty
2015-08-10 9:47 ` [PATCH v2 10/16] write_shared_index(): use tempfile module Michael Haggerty
2015-08-10 9:47 ` [PATCH v2 11/16] setup_temporary_shallow(): " Michael Haggerty
2015-08-10 9:47 ` [PATCH v2 12/16] diff: " Michael Haggerty
2015-08-11 20:03 ` Junio C Hamano
2015-08-12 15:13 ` Michael Haggerty
2015-08-12 16:41 ` Junio C Hamano
2015-08-12 17:12 ` [PATCH v2' " Michael Haggerty
2015-08-10 9:47 ` [PATCH v2 13/16] lock_repo_for_gc(): compute the path to "gc.pid" only once Michael Haggerty
2015-08-11 20:06 ` Junio C Hamano
2015-08-11 20:20 ` Junio C Hamano
2015-08-10 9:47 ` [PATCH v2 14/16] gc: use tempfile module to handle gc.pid file Michael Haggerty
2015-08-10 9:47 ` [PATCH v2 15/16] credential-cache--daemon: delete socket from main() Michael Haggerty
2015-08-10 9:47 ` [PATCH v2 16/16] credential-cache--daemon: use tempfile module Michael Haggerty
2015-08-11 20:21 ` [PATCH v2 00/16] Introduce a " Junio C Hamano
2015-08-12 15:14 ` Michael Haggerty
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqtws5r5gf.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=j6t@kdbg.org \
--cc=mhagger@alum.mit.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.