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 gits...@pobox.com wrote: Nguyễn Thái Ngọc Duy pclo...@gmail.com writes: (Only nitpicks during this round of review). + if (get_device_or_die(path) != get_device_or_die(get_git_dir())) { + strbuf_reset(sb); +

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 sunsh...@sunshineco.com 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

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

2014-02-20 Thread Junio C Hamano
Duy Nguyen pclo...@gmail.com 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

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

2014-02-19 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy pclo...@gmail.com 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,

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

2014-02-19 Thread Junio C Hamano
Junio C Hamano gits...@pobox.com writes: Nguyễn Thái Ngọc Duy pclo...@gmail.com 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);

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 pclo...@gmail.com wrote: The pruning rules are: - if $REPO/locked exists, repos/id 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

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 sunsh...@sunshineco.com wrote: On Tue, Feb 18, 2014 at 8:40 AM, Nguyễn Thái Ngọc Duy pclo...@gmail.com wrote: +static dev_t get_device_or_die(const char *path) +{ + struct stat buf; + if (stat(path, buf)) +

[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/id - 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