Skip to contentSkip to conversation

git/gitweb - feature request: Add description to the branches.

DISCUSSION Santi Béjar 5 participants 12 messages Jun 15, 2016 3 messages not in the archive

lore
Share & tools
lore
#0 lore raw

Hi:

First, thank you for this great tool.

One thing I'm missing is a way to describe a branch. It can be done in the $GIT_DIR/description, the first line for the whole repository and the rest for the branches. So description file for the git.git repository could be:

[description]
The core git plumbing
pu: Proposed updates
rc: Release candidate
todo: Todo list
[/description]

And it can be added to the gitweb tool.

Thanks.

Santi

#1 lore raw

Santi Béjar wrote:
[...]

Quoted 6 lines

One thing I'm missing is a way to describe a branch. It can be done in the $GIT_DIR/description, the first line for the whole repository and the rest for the branches. So description file for the git.git repository could be:

Quoted 8 lines

[description]
The core git plumbing
pu: Proposed updates
rc: Release candidate
todo: Todo list
[/description]

And it can be added to the gitweb tool.

Having somewhere to describe the intent of a branch would be a useful convention. But I think the descriptions should be in separate files; one for each branch and one for the repository as a whole.

That way it would be possible to have long, multi-line descriptions of the repository and branches with the tools displaying just the first line unless more information is requested; like gitk and gitkweb do with commit messages.

An unrelated gitweb feature request: include a timestamp near the top of the projects page so that I don't have to try to remember when I last reloaded the page. TZ=UTC preferred.

#2 lore raw

[RFC] GIT Repository Annotation Convention

GIT Repository Annotation Convention
====================================

GIT repositories can benefit from descriptions of /intent/ for portions of the repository. This document formalizes a method to store those descriptions in the repository.

Annotations
------------
Annotations are UTF8 text files. Each text starts with a one line summary, optionally followed by a blank line and a longer, more detailed description.

Annotations describe the /intended/ use or contents of the repository portion described. For instance, a branch is defined by a head ref; the annotation for that branch would describe what that branch is intended to hold, how to interpret and/or use the stored state, etc.

Naming and Directory Structure
------------------------------
Annotations are named by appending ".txt" to the basename of the repository component it describes, and by appending ".dir" to each directory patch component leading to the repository component from $GIT_DIR, and by prepending "annotations/" to the annotation pathname.

The use of the ".txt" and ".dir" suffixes is to allow for descriptions of hierarchical structures (directories) and well as specific components (files).

Missing annotations are ignored.

The file "$GIT_DIR/description", used by gitweb and other tools, becomes a symbolic link to "$GIT_DIR/annotations/description.txt".

Example Layout
--------------
$GIT_DIR/

	...
	annotations/
		...
		annotations.txt
		...
		description.txt
		...
		refs.dir/
			...
			heads.dir/
				<head dir 1>.dir/
					<head name 1.1>.txt
					...
					<head name 1.M>.txt
				<head dir 1>.txt
				...
				<head dir N>.dir/
					<head name N.1>.txt
					...
					<head name N.P>.txt
				<head name 1>.txt
				...
				<head name Q>.txt
			...
			tags.dir/
				<tag name 1>.txt
				...
				<tag name T>.txt
			...
	...
	description -> annotations/description.txt
	...

--

A message that is not in the archive (sent off-list or not yet received): [email protected]

#4 lore raw

Re: [RFC] GIT Repository Annotation Convention

Quoted 4 lines · Chuck Lever

yay! are you also proposing some git tools to deal with these? it would be great to have some version control (keep these like generation files so we can see the history of revisions).

Quoted 1 line · A Large Angry SCM

GIT Repository Annotation Convention

[...]

I'm not proposing any new tools, just a convention that existing tools or tools that others may create can adopt to provide information to a repositories users. Some existing tools that could use the annotations are:
git-branch
git-show-branch
gitweb
There are likely others.

Like any other file under $GIT_DIR, these files are not automatically versioned. Rather, each repository maintainer, needs to decide how a repository's meta-data (project meta-meta-data) is tracked or generated.

#5 lore raw

Re: [RFC] GIT Repository Annotation Convention

In reply to A Large Angry SCM
Quoted 6 lines · A Large Angry SCM

Naming and Directory Structure
------------------------------
Annotations are named by appending ".txt" to the basename of the repository component it describes, and by appending ".dir" to each directory patch component leading to the repository component from $GIT_DIR, and by prepending "annotations/" to the annotation pathname.

I suspect you can do the same without .dir but only with .txt.

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#8 lore raw

Re: [RFC] GIT Repository Annotation Convention

Quoted 11 lines · Junio C Hamano
Quoted 9 lines · A Large Angry SCM
Quoted 8 lines · Junio C Hamano
Quoted 6 lines · A Large Angry SCM

Naming and Directory Structure
------------------------------
Annotations are named by appending ".txt" to the basename of the repository component it describes, and by appending ".dir" to each directory patch component leading to the repository component from $GIT_DIR, and by prepending "annotations/" to the annotation pathname.

Quoted 4 lines
Quoted 2 lines
Quoted 1 line

I suspect you can do the same without .dir but only with .txt.

Think about a directory containing directories "foo" and "foo.txt":

And where do you see foo.txt under $GIT_DIR/ hierarchy?

Are you saying I can't name a branch "foo.txt"? Or have the following branches?

$GIT_DIR/refs/head/WidgetSoft/Blue
$GIT_DIR/refs/head/WidgetSoft/Red
$GIT_DIR/refs/head/WidgetSoft.txt/Blue
$GIT_DIR/refs/head/WidgetSoft.txt/Red

#9 lore raw

Re: [RFC] GIT Repository Annotation Convention

In reply to Junio C Hamano
Quoted 10 lines · Junio C Hamano
Quoted 6 lines · A Large Angry SCM

Naming and Directory Structure
------------------------------
Annotations are named by appending ".txt" to the basename of the repository component it describes, and by appending ".dir" to each directory patch component leading to the repository component from $GIT_DIR, and by prepending "annotations/" to the annotation pathname.

I suspect you can do the same without .dir but only with .txt.

Think about a directory containing directories "foo" and "foo.txt":

With ".dir":

	foo.dir/
		...
	foo.txt
	foo.txt.dir/
		...
	foo.txt.txt

Without ".dir":

	foo/
		...
==>	foo.txt
==>	foo.txt/
		...
	foo.txt.txt
#10 lore raw

Re: [RFC] GIT Repository Annotation Convention

Quoted 2 lines · A Large Angry SCM

Think about a directory containing directories "foo" and "foo.txt":

Can you tell us why you're using extensions in the first place?

I propose using no extensions whatsoever: simply mirror the refs/ tree.

Signature · 5 lines
Matthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  [email protected]
Disclaimer: The quote was selected randomly. Really. | http://smurf.noris.de
 - -
The rich get rich, and the poor get poorer.
The haves get more, the have-nots die.
#11 lore raw

Re: [RFC] GIT Repository Annotation Convention

Quoted 8 lines · Matthias Urlichs
Quoted 2 lines · A Large Angry SCM

Think about a directory containing directories "foo" and "foo.txt":

Can you tell us why you're using extensions in the first place?

I propose using no extensions whatsoever: simply mirror the refs/ tree.

The extensions allow the annotation of directories as well as files. That's something that can't be done if extensions are not used.

#12 lore raw

Re: [RFC] GIT Repository Annotation Convention

Quoted 11 lines · A Large Angry SCM
Quoted 7 lines · Matthias Urlichs
Quoted 2 lines · A Large Angry SCM

Think about a directory containing directories "foo" and "foo.txt":

Can you tell us why you're using extensions in the first place? I propose using no extensions whatsoever: simply mirror the refs/ tree.

The extensions allow the annotation of directories as well as files. That's something that can't be done if extensions are not used.

OTOH, for git directories are only there to organize files, they have no independent existence.

Signature · 4 lines
Dr. Horst H. von Brand                   User #22616 counter.li.org
Departamento de Informatica                     Fono: +56 32 654431
Universidad Tecnica Federico Santa Maria              +56 32 654239
Casilla 110-V, Valparaiso, Chile                Fax:  +56 32 797513
#13 lore raw

Re: [RFC] GIT Repository Annotation Convention

In reply to A Large Angry SCM
Quoted 4 lines · A Large Angry SCM
Quoted 1 line

I propose using no extensions whatsoever: simply mirror the refs/ tree.

The extensions allow the annotation of directories as well as files. That's something that can't be done if extensions are not used.

IMHO, that is the sort of information that's best saved in the "how is our source organized" section of your ./HACKING file.

Or you can simply use reiserfs4, with its files-are-directories feature. (*ducks and runs*)

Signature · 4 lines
Matthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  [email protected]
Disclaimer: The quote was selected randomly. Really. | http://smurf.noris.de
 - -
Ask yourself whether you are happy and you cease to be so.
#14 lore raw
In reply to A Large Angry SCM
Quoted 15 lines · A Large Angry SCM

Santi B.ANijar wrote:
[...]

Quoted 4 lines

One thing I'm missing is a way to describe a branch. It can
be
done in the $GIT_DIR/description, the first line for the whole repository and the rest for the branches. So description file

Quoted 8 lines

for the git.git repository could be:
[description]
The core git plumbing
pu: Proposed updates
rc: Release candidate
todo: Todo list
[/description]
And it can be added to the gitweb tool.

Quoted 3 lines

Having somewhere to describe the intent of a branch would be a useful convention. But I think the descriptions should be in separate files; one for each branch and one for the repository as a whole.

This reminds me of somebody else wanting to have 'motd' in git-daemon. Once we have a common data format we could also serve this information from there, and possibly from 'git fetch --motd'; pass that to 'git-peek-remote --motd' for git and ssh transports, and do something else using curl for http transport.

Anybody interested? I think the git-daemon side would be the cleanest if we introduce a new program to format the motd information and send it out, instead of attempting to enhance git-upload-pack protocol; I do not think the latter can be done in a backward compatible way.