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

Re: git branch --edit-description a custom file

From
PWPhillip Wood <phillip.wood123@gmail.com>
Date
Oct 31, 2019, 19:53 UTC
Message-ID
<4ef79cfb-b970-2b2b-131d-3f47e6b0e308@gmail.com>
In-Reply-To
<20191031181920.GB70819@generichostname>
Hi Denton & Dscho
On 31/10/2019 18:19, Denton Liu wrote:
Show 41 quoted lines
> Hi Dscho,
> 
> On Thu, Oct 31, 2019 at 11:22:16AM +0100, Johannes Schindelin wrote:
>> Hi Peff,
>>
>> On Thu, 31 Oct 2019, Jeff King wrote:
>>
>>> On Wed, Oct 30, 2019 at 03:43:28PM -0700, Denton Liu wrote:
>>>
>>>> On Wed, Oct 30, 2019 at 04:28:35PM -0400, Jeff King wrote:
>>>> Dscho brought up in the GGG thread[1] that perhaps we want to treat
>>>> branch descriptions like notes and have them all under something like
>>>> `refs/notes/branches`. This would certainly solve my problem of
>>>> having versioned descriptions and it would probably do it in a much more
>>>> general way than having a versioned included config.
>>>>
>>>> Anyone see any potential problems with this approach?
>>>
>>> I don't think it would be `refs/notes/`, as that is assumed to contain
>>> mappings of object ids (and if I understand correctly, this would be a
>>> mapping of branch names to data.
>>>
>>> You could just have "refs/meta/descriptions/foo" pointing to a blob
>>> which contains the description of "refs/heads/foo". That makes it easy
>>> to edit descriptions, even if you don't like using "git branch
>>> --edit-description".
>>
>> The only problem with this is that it's not really versioned, as it
>> would be hard to go back to previous versions and/or share the history
>> via pushing to a remote repository.
>>
>> But I guess that a very simple pseudo branch would do it, where
>> `refs/meta/<branch-name>` would point to a commit that has a tree
>> with a single file in it: `description.txt`.
> 
> So how would you envision the workflow for this? Would it be something
> like,
> 
> 	$ git checkout feature-1
> 
> 	$ git branch --edit-description=ref # instead of =config

Personally I'd prefer a config setting that meant --edit-description stored the description in a ref instead of the current config key (or perhaps as well as so format-patch can just get the latest branch description from the config key)

Show 25 quoted lines
> 	# editor opens up, :wq
> 
> 	# is it find to have an autogenerated commit message?
> 	$ git show refs/meta/feature-1
> 	commit 80dfea1dc4492aaabc80d23fbaffe86da55ee098 (refs/meta/feature-1)
> 	Author: Denton Liu <liu.denton@gmail.com>
> 	Date:   42 seconds ago
> 
> 	    Update ref description
> 
> 	diff --git a/description.txt b/description.txt
> 	new file mode 100644
> 	index 0000000..ed03a4b
> 	--- /dev/null
> 	+++ b/description.txt
> 	@@ -0,0 +1 @@
> 	+this is a description
> 
> I have some open questions about this, though:
> 
> * Since we're planning on sharing these descriptions with the outside
>    world, how would the ref layout look like? If we're not using the
>    refs/remotes namespace will it make fetching and merging notes harder?
>    I know that collaborating with notes is a pain so how do we avoid
>    making the same mistake?

I'd love to see a consensus around putting remote versions of refs/foo under refs/remote/<remote-name>/foo. To share notes I add a refspec that fetches to refs/remote/<remote-name>/notes. It is a pain that 'git pull' wont merge them for me though.

Show 7 quoted lines
> * On the above point, what if local descriptions are at
>    refs/meta/heads/feature-1 while remote descriptions are at
>    refs/meta/remotes/*/feature-1?
> 
> * What would a merge workflow look like? Would we have wrapper commands
>    for it or do users just have to checkout the description branch
>    themselves?

Teaching 'git pull' to (configurably) merge things under refs/remote/<remote-name>/foo to refs/foo would be a useful addition, then it could merge notes and any other refs people are sharing.

Best Wishes
Phillip
Show 9 quoted lines
> Thanks,
> 
> Denton
> 
>>
>> I now like that idea a lot better than my original notes idea.
>>
>> Ciao,
>> Dscho
Previous: Denton LiuNext: Jeff King
Message 14 of 21 in “git branch --edit-description a custom file”
  1. Denton LiuOct 30, 2019
  2. Jeff KingOct 30, 2019
  3. Denton LiuOct 30, 2019
  4. Jeff KingOct 31, 2019
  5. Johannes SchindelinOct 31, 2019
  6. Phillip WoodOct 31, 2019
  7. Johannes SchindelinOct 31, 2019
  8. Philip OakleyOct 31, 2019
  9. Jeff KingOct 31, 2019
  10. Philip OakleyNov 3, 2019
  11. Jeff KingNov 4, 2019
  12. Junio C HamanoNov 4, 2019
  13. Denton LiuOct 31, 2019
  14. Phillip WoodOct 31, 2019
  15. Jeff KingOct 31, 2019
  16. Phillip WoodNov 1, 2019
  17. Jeff KingNov 1, 2019
  18. Phillip WoodNov 1, 2019
  19. Junio C HamanoNov 2, 2019
  20. Denton LiuOct 31, 2019
  21. Jeff KingOct 31, 2019

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.