git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Shawn O. Pearce" <spearce@spearce.org>
To: Steffen Prohaska <prohaska@zib.de>
Cc: git@vger.kernel.org, msysgit@googlegroups.com
Subject: Re: [PATCH] git-gui: offer a list of recent repositories on startup
Date: Sun, 7 Oct 2007 19:30:23 -0400	[thread overview]
Message-ID: <20071007233023.GE2137@spearce.org> (raw)
In-Reply-To: <11917925011987-git-send-email-prohaska@zib.de>

Steffen Prohaska <prohaska@zib.de> wrote:
> If git-gui is started outside a work tree the repository
> chooser will offer a list of recently opend repositories.
> Clicking on an entry directly opens the repository.
> 
> The list of recently opened repositories is stored in the
> config as gui.recentrepos. If the list grows beyond 10
> entries it will be truncated.
> 
> Note, only repositories that are opened through the
> repository chooser will get added to the recent list.
> Repositories opened from the shell will not yet be added.

I think that all makes a lot of sense.  Three comments below about
this patch in particular.
 
> I'd suggest to reduce the number of clicks needed to open or
> clone an existing directory that is not in the list of
> recent repositories. First choosing from the radiobuttons
> and then clicking next is one click to much. There are no
> options to combine. Choosing from the list should
> immediately trigger the action.
> 
> We could either put 'Create/Clone/Open New Repository' into
> the Repository menu and only present the recent repository
> list. Or we could offer push buttons for the other actions.

I agree entirely.  That "Next" button is stupid stupid stupid.
What was I smoking that day?  :-)

I'm concerned about putting them into the Repository menu only
as then the main window is competely void and users are sort of
wondering what they should do next.  I think we should actually
do both.  Put them into the menu and as push buttons on the window.

> +	label $w_body.space
> +	label $w_body.recentlabel \
> +		-anchor w \
> +		-text "Select Recent Repository:"

This string needs to be i18n'd with [mc ...].

> +	listbox $w_body.recentlist \

Please make a field in this class called say "w_recentlist"
so you can use that field name instead of $w_body.recentlist.
This simplifies the code if we ever have to change the actual path
that the widget resides at, such as to alter the layout.

> +proc _append_recentrepos {path} {
> +	set recent [get_config gui.recentrepos]
> +	if {[lsearch $recent $path] < 0} {
> +		lappend recent $path
> +	}
> +	if {[llength $recent] > 10} {
> +		set recent [lrange $recent 1 end]
> +	}
> +	regsub -all "\[{}\]" $recent {"} recent
> +	git config --global gui.recentrepos $recent
> +}

Why treat this as a Tcl list in a single value?  Why not make it
a true multi-value configuration entry in ~/.gitconfig, like how
remote.$name.fetch is a multi-value entry?  Does Windows allow
you to put " in a path name?  Because the above regex will make
a list of paths that contains " in one of the entries invalid.

I think you also want to have this function return back immediately
if [lsearch $recent $path] >= 0 as then you don't invoke git-config
to perform a no-op change in the configuration file.  As you well
know forking on Windows is a major cost.  We shouldn't run git-config
just because the user opened a recent repository.

-- 
Shawn.

  reply	other threads:[~2007-10-07 23:30 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-07 21:28 [PATCH] git-gui: offer a list of recent repositories on startup Steffen Prohaska
2007-10-07 23:30 ` Shawn O. Pearce [this message]
2007-10-08 14:16   ` Steffen Prohaska
2007-10-09 11:43     ` [msysGit] " Johannes Schindelin
2007-10-09 12:42       ` Steffen Prohaska
2007-10-10  4:40         ` Shawn O. Pearce
2007-10-10 15:43           ` Johannes Schindelin
2007-10-10  7:30     ` Shawn O. Pearce
2007-10-10  8:13       ` [msysGit] " Steffen Prohaska
2007-10-10  8:19         ` Shawn O. Pearce

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071007233023.GE2137@spearce.org \
    --to=spearce@spearce.org \
    --cc=git@vger.kernel.org \
    --cc=msysgit@googlegroups.com \
    --cc=prohaska@zib.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).