Re: [PATCH v3 24/25] prune: strategies for linked checkouts

2014-02-20 Thread Junio C Hamano
Duy Nguyen writes: >> But why is it OK to fail in the first place? If we couldn't link, >> don't you want to fall back to the lock codepath? After all, the >> "are we on the same device?" check is to cope with the case where >> we cannot link and that alternate codepath is supposed to be >> pre

Re: [PATCH v3 24/25] prune: strategies for linked checkouts

2014-02-20 Thread Duy Nguyen
On Thu, Feb 20, 2014 at 5:08 AM, Eric Sunshine wrote: >> +static dev_t get_device_or_die(const char *path) >> +{ >> + struct stat buf; >> + if (stat(path, &buf)) >> + die_errno("failed to stat '%s'", path); >> + /* Ah Windows! Make different drives different "partit

Re: [PATCH v3 24/25] prune: strategies for linked checkouts

2014-02-20 Thread Duy Nguyen
On Thu, Feb 20, 2014 at 3:32 AM, Junio C Hamano wrote: > Nguyễn Thái Ngọc Duy writes: > > (Only nitpicks during this round of review). > >> + if (get_device_or_die(path) != get_device_or_die(get_git_dir())) { >> + strbuf_reset(&sb); >> + strbuf_addf(&sb, "%s/locked",

Re: [PATCH v3 24/25] prune: strategies for linked checkouts

2014-02-19 Thread Eric Sunshine
On Wed, Feb 19, 2014 at 5:08 PM, Eric Sunshine wrote: > On Tue, Feb 18, 2014 at 8:40 AM, Nguyễn Thái Ngọc Duy > wrote: >> +static dev_t get_device_or_die(const char *path) >> +{ >> + struct stat buf; >> + if (stat(path, &buf)) >> + die_errno("failed to stat '%s'", path)

Re: [PATCH v3 24/25] prune: strategies for linked checkouts

2014-02-19 Thread Eric Sunshine
On Tue, Feb 18, 2014 at 8:40 AM, Nguyễn Thái Ngọc Duy wrote: > The pruning rules are: > > - if $REPO/locked exists, repos/ is not supposed to be pruned. > > - if $REPO/locked exists and $REPO/gitdir's mtimer is older than a s/mtimer/mtime/ >really long limit, warn about old unused repo. >

Re: [PATCH v3 24/25] prune: strategies for linked checkouts

2014-02-19 Thread Junio C Hamano
Junio C Hamano writes: > Nguyễn Thái Ngọc Duy writes: > > (Only nitpicks during this round of review). > >> +if (get_device_or_die(path) != get_device_or_die(get_git_dir())) { >> +strbuf_reset(&sb); >> +strbuf_addf(&sb, "%s/locked", sb_repo.buf); >> +writ

Re: [PATCH v3 24/25] prune: strategies for linked checkouts

2014-02-19 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy writes: (Only nitpicks during this round of review). > + if (get_device_or_die(path) != get_device_or_die(get_git_dir())) { > + strbuf_reset(&sb); > + strbuf_addf(&sb, "%s/locked", sb_repo.buf); > + write_file(sb.buf, 1, "located on a

[PATCH v3 24/25] prune: strategies for linked checkouts

2014-02-18 Thread Nguyễn Thái Ngọc Duy
alias REPO=$GIT_COMMON_DIR/repos/ - linked checkouts are supposed to update mtime of $REPO/gitdir - linked checkouts are supposed to keep its location in $REPO/gitdir up to date - "git checkout --to" is supposed to create $REPO/locked if the new repo is on a different partition than the