Issue918

Title Option to copy some of .hg/hgrc upon local clone
Priority wish Status chatting
Superseder Nosy List jglick, kupfer, mpm, parren, sborho
Assigned To Topics ui

Created on 2008-01-07.20:34:35 by jglick, last changed 2008-02-05.22:20:23 by kupfer.

Messages
msg4898 (view) Author: jglick Date: 2008-01-16.18:46:18
Lengthy discussion written up at:

http://www.selenic.com/mercurial/wiki/index.cgi/SpecificHgrcForSetsOfRepos
msg4855 (view) Author: mpm Date: 2008-01-09.17:27:14
I'm much more likely to accept the directory hierarchy approach.
msg4852 (view) Author: jglick Date: 2008-01-09.15:53:48
Peter Arrenbrecht also suggested an alternative: search for .hgrc in ancestor
directories of the repository. This would be simple to understand and use and
cover my original use case.

It would not cover Steve's use case as this would work only locally. Generally
copying settings from a remote repository could be problematic for security.
msg4851 (view) Author: sborho Date: 2008-01-09.13:59:06
On Mon, 2008-01-07 at 20:34 +0000, Jesse Glick wrote:
> New submission from Jesse Glick <jesse.glick@sun.com>:
> 
> Sometimes there are important pieces of configuration in .hg/hgrc which (1)
> cannot be in global config, (2) would make sense in most or all clones of that
> repo as well (just not in unrelated repos).
> 
> In particular, ui.username may need to have a project-specific value. For
> working on Hg sources, I want to use my full email address. For working on
> NetBeans sources, I want to use 'jglick' - a login ID tied to authentication and
> other site functions such as bug tracking.
> 
> When doing an initial clone of the remote repository, I need to remember to set
> 
> [ui]
> username=jglick
> 
> which is OK. But when I do a local clone, I need to remember to set it again,
> which is irritating.
> 
> It would be nice if there were some way to mark in hgrc that certain sections
> ought to be copied to the new hgrc after a local clone (subject to the normal
> security checks, i.e. only if cloned by the same user). Perhaps
> 
> [clone]
> username.ui =

+1 on this.  I would really like to be able to put into my public facing
repositories:

[clone]
email.to = my-email@example.com
msg4844 (view) Author: parren Date: 2008-01-08.20:20:07
+1.
-peo

On Jan 7, 2008 9:34 PM, Jesse Glick <mercurial-bugs@selenic.com> wrote:
>
> New submission from Jesse Glick <jesse.glick@sun.com>:
>
> Sometimes there are important pieces of configuration in .hg/hgrc which (1)
> cannot be in global config, (2) would make sense in most or all clones of that
> repo as well (just not in unrelated repos).
>
> In particular, ui.username may need to have a project-specific value. For
> working on Hg sources, I want to use my full email address. For working on
> NetBeans sources, I want to use 'jglick' - a login ID tied to authentication and
> other site functions such as bug tracking.
>
> When doing an initial clone of the remote repository, I need to remember to set
>
> [ui]
> username=jglick
>
> which is OK. But when I do a local clone, I need to remember to set it again,
> which is irritating.
>
> It would be nice if there were some way to mark in hgrc that certain sections
> ought to be copied to the new hgrc after a local clone (subject to the normal
> security checks, i.e. only if cloned by the same user). Perhaps
>
> [clone]
> username.ui =
>
> and the clone command would check for any keys listed in this section and try to
> copy them.
>
> Would be happy to supply a patch if it is agreed the enhancement would be desirable.
>
> ----------
> messages: 4837
> nosy: jglick
> priority: wish
> status: unread
> title: Option to copy some of .hg/hgrc upon local clone
> topic: ui
>
> ____________________________________________________
> Mercurial issue tracker <mercurial-bugs@selenic.com>
> <http://www.selenic.com/mercurial/bts/issue918>
> ____________________________________________________
>
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel
>
msg4842 (view) Author: mpm Date: 2008-01-07.22:22:09
There are generic pre- and post- hooks for all commands.
msg4841 (view) Author: jglick Date: 2008-01-07.22:20:55
Is there such a thing as a post-clone hook? I see none documented in the book.
msg4840 (view) Author: mpm Date: 2008-01-07.22:14:01
This might be better handled with a post-clone command hook.
msg4837 (view) Author: jglick Date: 2008-01-07.20:34:34
Sometimes there are important pieces of configuration in .hg/hgrc which (1)
cannot be in global config, (2) would make sense in most or all clones of that
repo as well (just not in unrelated repos).

In particular, ui.username may need to have a project-specific value. For
working on Hg sources, I want to use my full email address. For working on
NetBeans sources, I want to use 'jglick' - a login ID tied to authentication and
other site functions such as bug tracking.

When doing an initial clone of the remote repository, I need to remember to set

[ui]
username=jglick

which is OK. But when I do a local clone, I need to remember to set it again,
which is irritating.

It would be nice if there were some way to mark in hgrc that certain sections
ought to be copied to the new hgrc after a local clone (subject to the normal
security checks, i.e. only if cloned by the same user). Perhaps

[clone]
username.ui =

and the clone command would check for any keys listed in this section and try to
copy them.

Would be happy to supply a patch if it is agreed the enhancement would be desirable.
History
Date User Action Args
2008-02-05 22:20:23kupfersetnosy: + kupfer
2008-01-16 18:46:20jglicksetnosy: mpm, sborho, jglick, parren
messages: + msg4898
2008-01-09 17:27:14mpmsetnosy: mpm, sborho, jglick, parren
messages: + msg4855
2008-01-09 15:53:50jglicksetnosy: mpm, sborho, jglick, parren
messages: + msg4852
2008-01-09 13:59:07sborhosetnosy: + sborho
messages: + msg4851
2008-01-08 20:20:07parrensetnosy: + parren
messages: + msg4844
2008-01-07 22:22:10mpmsetmessages: + msg4842
2008-01-07 22:20:56jglicksetmessages: + msg4841
2008-01-07 22:14:02mpmsetstatus: unread -> chatting
nosy: + mpm
messages: + msg4840
2008-01-07 20:34:35jglickcreate