git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] git-rerere.txt: Mention rr-cache directory

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jul 9, 2008, 00:38 UTC
Message-ID
<alpine.DEB.1.00.0807090230560.5277@eeepc-johanness>
In-Reply-To
<alpine.DEB.1.00.0807090225050.5277@eeepc-johanness>
Hi,
On Wed, 9 Jul 2008, Johannes Schindelin wrote:
Show 7 quoted lines
> 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

Previous: Johannes SchindelinNext: Junio C Hamano
Message 3 of 11 in “git-rerere.txt: Mention rr-cache directory”
  1. git-rerere.txt: Mention rr-cache directoryStephan Beyer, Jul 9, 2008
  2. Johannes SchindelinJul 9, 2008
  3. Johannes SchindelinJul 9, 2008
  4. Junio C HamanoJul 9, 2008
  5. Stephan BeyerJul 9, 2008
  6. rerere: Separate libgit and builtin functionsStephan Beyer, Jul 9, 2008
  7. Johannes SchindelinJul 9, 2008
  8. Stephan BeyerJul 9, 2008
  9. [PATCHv2] rerere: Separate libgit and builtin functionsStephan Beyer, Jul 9, 2008
  10. Johannes SchindelinJul 9, 2008
  11. Junio C HamanoJul 9, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.