threads / discuss / 18324

adding files in .git?

Subject: adding files in .git?

## tl;dr

3 messages between Mar 16, 2009 and Mar 16, 2009.

replies: 2people: 3as markdown or json

E R· Mar 16, 2009, 15:14 UTC · lore

I'd like to add a "short description" attribute to my .git repository. This would be used by my bash prompt setting function in creating the PS1 string. How would you recommend that this be implemented?

My ideas are:
1) Use another file in .git similar to the "description" file (such as
.git/short-description)
2) Use a setting in the .git/config file.

Any comments on the advantages/disadvantages of these approaches? Or is there yet another better way?

Thanks,
ER
Shawn O. Pearce· Mar 16, 2009, 15:18 UTC · re: E R · lore

Re: adding files in .git?

E R <pc88mxer@gmail.com> wrote:
Show 12 quoted lines
> I'd like to add a "short description" attribute to my .git repository.
> This would be used by my bash prompt setting function in creating the
> PS1 string. How would you recommend that this be implemented?
> 
> My ideas are:
> 
> 1) Use another file in .git similar to the "description" file (such as
> .git/short-description)
> 2) Use a setting in the .git/config file.
> 
> Any comments on the advantages/disadvantages of these approaches? Or
> is there yet another better way?

Using another file may be faster to execute as you can probably read the file directly in shell, vs. needing to fork to read the file with `git config`.

But there really isn't a huge argument either way other than that.
-- 
Shawn.
Matthieu Moy· Mar 16, 2009, 16:56 UTC · re: E R · lore

Re: adding files in .git?

E R <pc88mxer@gmail.com> writes:
Show 5 quoted lines
> 1) Use another file in .git similar to the "description" file (such as
> .git/short-description)
> 2) Use a setting in the .git/config file.
>
> Any comments on the advantages/disadvantages of these approaches?

Neither of them will propagate through clone. Depending on your use-case, this is an advantage or not.

-- 
Matthieu

← back to recent threads