From: Junio C Hamano <gitster@pobox.com>
To: Markus Heidelberg <markus.heidelberg@web.de>
Cc: git@vger.kernel.org, Jeff King <peff@peff.net>
Subject: Re: [PATCH v2 4/4] git status: refresh the index if possible
Date: Fri, 02 Apr 2010 21:33:16 -0700 [thread overview]
Message-ID: <7v1vex9mur.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <1270244661-24173-1-git-send-email-markus.heidelberg@web.de> (Markus Heidelberg's message of "Fri\, 2 Apr 2010 23\:44\:21 +0200")
Markus Heidelberg <markus.heidelberg@web.de> writes:
> Is rollback_lock_file(&index_lock) necessary? It isn't used in
> "git commit --dry-run" when commit_style is COMMIT_AS_IS.
That is because AS_IS commit does not even lock anything for writing, as
AS_IS means just that: "git commit" does not touch the index but just
writes tree out of the index.
Upon program exit (unless you get an uncontrolled crash), the lockfile API
arranges atexit(3) to roll back the lockfiles, so it probably may not make
much of a difference if you omitted rollback_lock_file(&index_lock)
yourself, but it is a good idea to clean up the mess you made after you
are done, especially if the mess is not something the operating system
will clean up for us (e.g. open file descriptors, malloc'ed region of
memory etc.)
To make sure that the failure case is covered, you may also want to add a
test case where you run "chmod a-w $GIT_DIR" and then run status (but that
test needs to be conditional on POSIXPERM).
Thanks.
next prev parent reply other threads:[~2010-04-03 4:33 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-02 12:27 [PATCH 0/4] fix regression that "git status" doesn't refresh the index Markus Heidelberg
2010-04-02 12:27 ` [PATCH 1/4] builtin/commit: fix duplicated sentence in a comment Markus Heidelberg
2010-04-02 12:27 ` [PATCH 2/4] builtin/commit: remove unnecessary variable definition Markus Heidelberg
2010-04-02 12:27 ` [PATCH 3/4] t7508: add test for "git status" refreshing the index Markus Heidelberg
2010-04-02 12:27 ` [PATCH 4/4] git status: refresh " Markus Heidelberg
2010-04-02 16:57 ` Jeff King
2010-04-02 20:37 ` Markus Heidelberg
2010-04-02 21:21 ` Jeff King
2010-04-02 18:56 ` Junio C Hamano
2010-04-02 20:39 ` Markus Heidelberg
2010-04-02 21:44 ` [PATCH v2 4/4] git status: refresh the index if possible Markus Heidelberg
2010-04-03 4:33 ` Junio C Hamano [this message]
2010-04-03 10:11 ` [PATCH] t7508: add a test for "git status" in a read-only repository Markus Heidelberg
2010-04-06 6:20 ` Junio C Hamano
2010-04-03 10:33 ` [PATCH v2 4/4] git status: refresh the index if possible Markus Heidelberg
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=7v1vex9mur.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=markus.heidelberg@web.de \
--cc=peff@peff.net \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).