From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Stephan Beyer <s-beyer@gmx.net>
Cc: Junio C Hamano <gitster@pobox.com>, git@vger.kernel.org
Subject: Re: [PATCH] git-rerere.txt: Mention rr-cache directory
Date: Wed, 9 Jul 2008 02:38:15 +0200 (CEST) [thread overview]
Message-ID: <alpine.DEB.1.00.0807090230560.5277@eeepc-johanness> (raw)
In-Reply-To: <alpine.DEB.1.00.0807090225050.5277@eeepc-johanness>
Hi,
On Wed, 9 Jul 2008, Johannes Schindelin wrote:
> On Wed, 9 Jul 2008, Stephan Beyer wrote:
>
> > If a user reads the rerere documentation, he or she is not told to
> > create the $GIT_DIR/rr-cache directory to be able to use git-rerere.
>
> Is it? The config setting is not enough? Then that is a bug, and should
> not be blessed by a bug in the documentation.
Okay, I took a look:
-- snip --
static int is_rerere_enabled(void)
{
struct stat st;
const char *rr_cache;
int rr_cache_exists;
if (!rerere_enabled)
return 0;
rr_cache = git_path("rr-cache");
rr_cache_exists = !stat(rr_cache, &st) && S_ISDIR(st.st_mode);
if (rerere_enabled < 0)
return rr_cache_exists;
if (!rr_cache_exists &&
(mkdir(rr_cache, 0777) || adjust_shared_perm(rr_cache)))
die("Could not create directory %s", rr_cache);
return 1;
}
-- snap --
As you can see, in the case rerere_enabled < 0 (i.e. the config did not
say anything about rerere), it is assumed enabled _exactly_ when
.git/rr_cache/ exists.
But if it is > 0, the directory is created.
Of course, this only holds true when the config is read, i.e. when
setup_rerere() was called in time. Which is the case when you call
rerere() (as is done both from cmd_rerere() as well as cmd_commit()).
Of course, I haven't tested it. Other than running the test script, that
is.
So care to elaborate what is going wrong?
BTW I think it is a horrible thing that rerere() is declared in commit.h
(a libgit header), but implemented in builtin-rerere.c, which is not part
of libgit.a.
Ciao,
Dscho
next prev parent reply other threads:[~2008-07-09 0:39 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-09 0:17 [PATCH] git-rerere.txt: Mention rr-cache directory Stephan Beyer
2008-07-09 0:25 ` Johannes Schindelin
2008-07-09 0:38 ` Johannes Schindelin [this message]
2008-07-09 1:09 ` Junio C Hamano
2008-07-09 9:21 ` Stephan Beyer
2008-07-09 10:18 ` [PATCH] rerere: Separate libgit and builtin functions Stephan Beyer
2008-07-09 11:55 ` Johannes Schindelin
2008-07-09 12:00 ` Stephan Beyer
2008-07-09 12:58 ` [PATCHv2] " Stephan Beyer
2008-07-09 12:03 ` [PATCH] " Johannes Schindelin
2008-07-09 18:25 ` Junio C Hamano
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=alpine.DEB.1.00.0807090230560.5277@eeepc-johanness \
--to=johannes.schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=s-beyer@gmx.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