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

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

From
Denton Liu <liu.denton@gmail.com>
Date
Oct 31, 2019, 17:35 UTC
Message-ID
<20191031173507.GA70819@generichostname>
In-Reply-To
<20191031061832.GA20830@sigill.intra.peff.net>
On Thu, Oct 31, 2019 at 02:18:32AM -0400, Jeff King wrote:
Show 29 quoted lines
> 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".
> 
> You could also have "refs/meta/descriptions" to point to a _single_ blob
> with all of the descriptions. It could even be in the existing config
> format. And then you could include it with "[include] blob = ...". That
> doesn't exist yet, but it would be easy to add (it was something I had
> always considered when writing the config-include code, but there was
> never really a good use; and you do have to be careful about pointing to
> untrusted blobs). That's a convoluted way to get where you want, but I
> wonder if integrating to the existing config system would have any
> benefits. I haven't really thought it through.
I like the ability to include blobs for several reasons:

Main one is that it handles the versioned branch description problem. But it goes further than that, there are a lot of config properties that teams might want to share amongst each other. For example, whenever a project has a custom smudge filter, usually they include some sort of config in the project's README or some sort of setup script. With some way to include a shared version of some config, this might be simpler.

Show 7 quoted lines
> 
> (Of course that's also only one step away from having a versioned config
> file in your .git directory, but it might possibly be a bit easier to
> manage, since it would always be committed).
> 
> That's mostly off-the-top-of-my-head rambling, so please disregard
> anything that seems totally off-base. :)

Thanks for the discussion on this, I probably won't be implementing the blob config stuff for the purpose of branch descriptions but I think it's a good thing to think about.

> 
> -Peff
Previous: Junio C HamanoNext: Jeff King
Message 20 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.