Re: [PATCH v7 2/8] cherry-pick: treat CHERRY_PICK_HEAD and REVERT_HEAD as refs

2015-07-15 Thread David Turner
On Wed, 2015-07-15 at 09:24 -0700, Junio C Hamano wrote: > > On reflection, I think that this would also be a reasonable approach to > > take for stash, which does not fall into any of the listed categories. > > It's not a pseudoref because it's not all-caps and it starts with refs/. > > Unlike oth

Re: [PATCH v7 2/8] cherry-pick: treat CHERRY_PICK_HEAD and REVERT_HEAD as refs

2015-07-15 Thread Junio C Hamano
David Turner writes: > So I am thinking instead that backends should be required to manage > updates to HEAD themselves, and that some functions from refs-be-files > would be made generic to help with this. > ... > For the LMDB backend, I could put most of that code at the LMDB access > ... > b

Re: [PATCH v7 2/8] cherry-pick: treat CHERRY_PICK_HEAD and REVERT_HEAD as refs

2015-07-13 Thread David Turner
[j6t to bcc as it looks like his concerns have been addressed] On Fri, 2015-07-10 at 06:30 +0200, Michael Haggerty wrote: > On 07/10/2015 12:06 AM, Junio C Hamano wrote: > > David Turner writes: > > > >> OK, here's my current best idea: > >> > >> 1. A "pseudoref" is an all-caps file in $GIT_DIR/

Re: [PATCH v7 2/8] cherry-pick: treat CHERRY_PICK_HEAD and REVERT_HEAD as refs

2015-07-10 Thread David Turner
On Fri, 2015-07-10 at 06:30 +0200, Michael Haggerty wrote: > On 07/10/2015 12:06 AM, Junio C Hamano wrote: > > David Turner writes: > > > >> OK, here's my current best idea: > >> > >> 1. A "pseudoref" is an all-caps file in $GIT_DIR/ that always contains > >> at least a SHA1. CHERRY_PICK_HEAD an

Re: [PATCH v7 2/8] cherry-pick: treat CHERRY_PICK_HEAD and REVERT_HEAD as refs

2015-07-09 Thread Michael Haggerty
On 07/10/2015 12:06 AM, Junio C Hamano wrote: > David Turner writes: > >> OK, here's my current best idea: >> >> 1. A "pseudoref" is an all-caps file in $GIT_DIR/ that always contains >> at least a SHA1. CHERRY_PICK_HEAD and REVERT_HEAD are examples. Because >> HEAD might be a symbolic ref, it i

Re: [PATCH v7 2/8] cherry-pick: treat CHERRY_PICK_HEAD and REVERT_HEAD as refs

2015-07-09 Thread Junio C Hamano
David Turner writes: > OK, here's my current best idea: > > 1. A "pseudoref" is an all-caps file in $GIT_DIR/ that always contains > at least a SHA1. CHERRY_PICK_HEAD and REVERT_HEAD are examples. Because > HEAD might be a symbolic ref, it is not a pseudoref. > > Refs backends do not manage pse

Re: [PATCH v7 2/8] cherry-pick: treat CHERRY_PICK_HEAD and REVERT_HEAD as refs

2015-07-09 Thread David Turner
On Wed, 2015-07-08 at 22:55 -0700, Junio C Hamano wrote: > David Turner writes: > > > I didn't see this until after I had sent my previous message. I think > > the "multiple working trees" argument is strong enough that I will > > change the code (and tests). > > Not just code, but we probably

Re: [PATCH v7 2/8] cherry-pick: treat CHERRY_PICK_HEAD and REVERT_HEAD as refs

2015-07-08 Thread Junio C Hamano
David Turner writes: > I didn't see this until after I had sent my previous message. I think > the "multiple working trees" argument is strong enough that I will > change the code (and tests). Not just code, but we probably should step back a bit and clearly define what we are trying to achiev

Re: [PATCH v7 2/8] cherry-pick: treat CHERRY_PICK_HEAD and REVERT_HEAD as refs

2015-07-08 Thread David Turner
On Wed, 2015-07-08 at 16:23 -0700, Junio C Hamano wrote: > Johannes Sixt writes: > > >> We could reduce the number from two to one by providing a new > >> git-am-status command which outputs one of "CHERRY-PICKING", > >> "REVERTING", or "" (or maybe it would also handle rebase and am). We > >> c

Re: [PATCH v7 2/8] cherry-pick: treat CHERRY_PICK_HEAD and REVERT_HEAD as refs

2015-07-08 Thread David Turner
On Wed, 2015-07-08 at 23:14 +0200, Johannes Sixt wrote: > Am 08.07.2015 um 21:16 schrieb David Turner: > > On Wed, 2015-07-08 at 19:46 +0200, Johannes Sixt wrote: > >> Am 08.07.2015 um 02:55 schrieb David Turner: > >>> Instead of directly writing to and reading from files in > >>> $GIT_DIR, use ref

Re: [PATCH v7 2/8] cherry-pick: treat CHERRY_PICK_HEAD and REVERT_HEAD as refs

2015-07-08 Thread Junio C Hamano
Johannes Sixt writes: >> We could reduce the number from two to one by providing a new >> git-am-status command which outputs one of "CHERRY-PICKING", >> "REVERTING", or "" (or maybe it would also handle rebase and am). We >> could also generalize it to "git-prompt-helper" or something by moving

Re: [PATCH v7 2/8] cherry-pick: treat CHERRY_PICK_HEAD and REVERT_HEAD as refs

2015-07-08 Thread Johannes Sixt
Am 08.07.2015 um 21:16 schrieb David Turner: On Wed, 2015-07-08 at 19:46 +0200, Johannes Sixt wrote: Am 08.07.2015 um 02:55 schrieb David Turner: Instead of directly writing to and reading from files in $GIT_DIR, use ref API to interact with CHERRY_PICK_HEAD and REVERT_HEAD. Signed-off-by: Dav

Re: [PATCH v7 2/8] cherry-pick: treat CHERRY_PICK_HEAD and REVERT_HEAD as refs

2015-07-08 Thread David Turner
On Wed, 2015-07-08 at 19:46 +0200, Johannes Sixt wrote: > Am 08.07.2015 um 02:55 schrieb David Turner: > > Instead of directly writing to and reading from files in > > $GIT_DIR, use ref API to interact with CHERRY_PICK_HEAD > > and REVERT_HEAD. > > > > Signed-off-by: David Turner > > --- > ... > >

Re: [PATCH v7 2/8] cherry-pick: treat CHERRY_PICK_HEAD and REVERT_HEAD as refs

2015-07-08 Thread Johannes Sixt
Am 08.07.2015 um 02:55 schrieb David Turner: Instead of directly writing to and reading from files in $GIT_DIR, use ref API to interact with CHERRY_PICK_HEAD and REVERT_HEAD. Signed-off-by: David Turner --- ... diff --git a/contrib/completion/git-prompt.sh b/contrib/completion/git-prompt.sh i

[PATCH v7 2/8] cherry-pick: treat CHERRY_PICK_HEAD and REVERT_HEAD as refs

2015-07-07 Thread David Turner
Instead of directly writing to and reading from files in $GIT_DIR, use ref API to interact with CHERRY_PICK_HEAD and REVERT_HEAD. Signed-off-by: David Turner --- branch.c | 4 ++-- builtin/commit.c | 6 +++--- builtin/merge.c | 2 +- co