Re: [PATCH] completion: complete remote names too
It was <2018-05-30 śro 17:37>, when Duy Nguyen wrote: > On Fri, May 25, 2018 at 12:48:42PM +0200, Łukasz Stelmach wrote: >> "git remote update" accepts both groups and single remotes. >> >> Signed-off-by: Łukasz Stelmach >> --- >> contrib/completion/git-completion.bash | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/contrib/completion/git-completion.bash >> b/contrib/completion/git-completion.bash >> index 961a0ed76..fb05bb2f9 100644 >> --- a/contrib/completion/git-completion.bash >> +++ b/contrib/completion/git-completion.bash >> @@ -2632,7 +2632,7 @@ _git_remote () >> __gitcomp_builtin remote_update >> ;; >> update,*) >> -__gitcomp "$(__git_get_config_variables "remotes")" >> +__gitcomp "$(__git_remotes) $(__git_get_config_variables >> "remotes")" > > Reviewed-by: me. > > The short commit description actually made me curious, which led to > more digging and finally this follow up patch. > > -- 8< -- > Subject: [PATCH] remote.txt: update documentation for 'update' command > > Commit b344e1614b (git remote update: Fallback to remote if group does > not exist - 2009-04-06) lets "git remote update" accept individual > remotes as well. Previously this command only accepted remote > groups. The commit updates the command syntax but not the actual > document of this subcommand. Update it. > > Signed-off-by: Nguyễn Thái Ngọc Duy > --- > Documentation/git-remote.txt | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/Documentation/git-remote.txt b/Documentation/git-remote.txt > index 595948da53..dd38587168 100644 > --- a/Documentation/git-remote.txt > +++ b/Documentation/git-remote.txt > @@ -186,8 +186,8 @@ actually prune them. > > 'update':: > > -Fetch updates for a named set of remotes in the repository as defined by > -remotes.. If a named group is not specified on the command line, > +Fetch updates for remotes or remote groups in the repository as defined by > +remotes.. If no group or remote is not specified on the command line, If neither group nor remote is specified on the command line, > the configuration parameter remotes.default will be used; if > remotes.default is not defined, all remotes which do not have the > configuration parameter remote..skipDefaultUpdate set to true will -- Łukasz Stelmach Samsung R Institute Poland Samsung Electronics signature.asc Description: PGP signature
[PATCH] completion: complete remote names too
"git remote update" accepts both groups and single remotes. Signed-off-by: Łukasz Stelmach <l.stelm...@samsung.com> --- contrib/completion/git-completion.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 961a0ed76..fb05bb2f9 100644 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -2632,7 +2632,7 @@ _git_remote () __gitcomp_builtin remote_update ;; update,*) - __gitcomp "$(__git_get_config_variables "remotes")" + __gitcomp "$(__git_remotes) $(__git_get_config_variables "remotes")" ;; set-url,--*) __gitcomp_builtin remote_set-url -- 2.11.0
Re: [PATCH v4] git-gui: Prevent double UTF-8 conversion
It was <2017-12-14 czw 10:42>, when Eric Sunshine wrote: > On Thu, Dec 14, 2017 at 4:32 AM, Łukasz Stelmach <l.stelm...@samsung.com> > wrote: >> Convert author's name and e-mail address from the UTF-8 (or any other) >> encoding in load_last_commit function the same way commit message is >> converted. >> >> Amending commits in git-gui without such conversion breaks UTF-8 >> strings. For example, "\305\201ukasz" (as written by git cat-file) becomes >> "\303\205\302\201ukasz" in an amended commit. >> >> Signed-off-by: Łukasz Stelmach <l.stelm...@samsung.com> >> Reviewed-by: Johannes Schindelin <johannes.schinde...@gmx.de> >> --- >> Changes since v3: >> >> - Added Reviewed-by footer. Thank you Johannes Schindelin, for review. > > No need to re-send. If you consult Junio's latest "What's cooking"[1], > you'll find that your patch has already graduated from his 'pu' branch > to 'next' and is slated to graduate to 'master' (at some point). > > [1]: > https://public-inbox.org/git/xmqqzi6mutcc....@gitster.mtv.corp.google.com/ I am sorry. I didn't get any notifiaction by mail and I haven't studied Documentation/SubmittingPatches throughly enough. -- Łukasz Stelmach Samsung R Institute Poland Samsung Electronics signature.asc Description: PGP signature
[PATCH v4] git-gui: Prevent double UTF-8 conversion
Convert author's name and e-mail address from the UTF-8 (or any other) encoding in load_last_commit function the same way commit message is converted. Amending commits in git-gui without such conversion breaks UTF-8 strings. For example, "\305\201ukasz" (as written by git cat-file) becomes "\303\205\302\201ukasz" in an amended commit. Signed-off-by: Łukasz Stelmach <l.stelm...@samsung.com> Reviewed-by: Johannes Schindelin <johannes.schinde...@gmx.de> --- Changes since v3: - Added Reviewed-by footer. Thank you Johannes Schindelin, for review. git-gui/lib/commit.tcl | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/git-gui/lib/commit.tcl b/git-gui/lib/commit.tcl index 83620b7cb..75ea965da 100644 --- a/git-gui/lib/commit.tcl +++ b/git-gui/lib/commit.tcl @@ -25,6 +25,8 @@ You are currently in the middle of a merge that has not been fully completed. Y set msg {} set parents [list] if {[catch { + set name "" + set email "" set fd [git_read cat-file commit $curHEAD] fconfigure $fd -encoding binary -translation lf # By default commits are assumed to be in utf-8 @@ -34,9 +36,7 @@ You are currently in the middle of a merge that has not been fully completed. Y lappend parents [string range $line 7 end] } elseif {[string match {encoding *} $line]} { set enc [string tolower [string range $line 9 end]] - } elseif {[regexp "author (.*)\\s<(.*)>\\s(\\d.*$)" $line all name email time]} { - set commit_author [list name $name email $email date $time] - } + } elseif {[regexp "author (.*)\\s<(.*)>\\s(\\d.*$)" $line all name email time]} { } } set msg [read $fd] close $fd @@ -44,7 +44,13 @@ You are currently in the middle of a merge that has not been fully completed. Y set enc [tcl_encoding $enc] if {$enc ne {}} { set msg [encoding convertfrom $enc $msg] + set name [encoding convertfrom $enc $name] + set email [encoding convertfrom $enc $email] } + if {$name ne {} && $email ne {}} { + set commit_author [list name $name email $email date $time] + } + set msg [string trim $msg] } err]} { error_popup [strcat [mc "Error loading commit data for amend:"] "\n\n$err"] -- 2.11.0
[PATCH v3] git-gui: Prevent double UTF-8 conversion
Convert author's name and e-mail address from the UTF-8 (or any other) encoding in load_last_commit function the same way commit message is converted. Amending commits in git-gui without such conversion breaks UTF-8 strings. For example, "\305\201ukasz" (as written by git cat-file) becomes "\303\205\302\201ukasz" in an amended commit. Signed-off-by: Łukasz Stelmach <l.stelm...@samsung.com> --- git-gui/lib/commit.tcl | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/git-gui/lib/commit.tcl b/git-gui/lib/commit.tcl index 83620b7cb..75ea965da 100644 --- a/git-gui/lib/commit.tcl +++ b/git-gui/lib/commit.tcl @@ -25,6 +25,8 @@ You are currently in the middle of a merge that has not been fully completed. Y set msg {} set parents [list] if {[catch { + set name "" + set email "" set fd [git_read cat-file commit $curHEAD] fconfigure $fd -encoding binary -translation lf # By default commits are assumed to be in utf-8 @@ -34,9 +36,7 @@ You are currently in the middle of a merge that has not been fully completed. Y lappend parents [string range $line 7 end] } elseif {[string match {encoding *} $line]} { set enc [string tolower [string range $line 9 end]] - } elseif {[regexp "author (.*)\\s<(.*)>\\s(\\d.*$)" $line all name email time]} { - set commit_author [list name $name email $email date $time] - } + } elseif {[regexp "author (.*)\\s<(.*)>\\s(\\d.*$)" $line all name email time]} { } } set msg [read $fd] close $fd @@ -44,7 +44,13 @@ You are currently in the middle of a merge that has not been fully completed. Y set enc [tcl_encoding $enc] if {$enc ne {}} { set msg [encoding convertfrom $enc $msg] + set name [encoding convertfrom $enc $name] + set email [encoding convertfrom $enc $email] } + if {$name ne {} && $email ne {}} { + set commit_author [list name $name email $email date $time] + } + set msg [string trim $msg] } err]} { error_popup [strcat [mc "Error loading commit data for amend:"] "\n\n$err"] -- 2.11.0
[PATCH v2] git-gui: Prevent double UTF-8 conversion
Convert author's name from the UTF-8 (or any other) encoding in load_last_commit function the same way commit message is converted. Amending commits in git-gui without such conversion breaks UTF-8 strings. For example, "\305\201ukasz" (as written by git cat-file) becomes "\303\205\302\201ukasz" in an amended commit. Signed-off-by: Łukasz Stelmach <l.stelm...@samsung.com> --- git-gui/lib/commit.tcl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/git-gui/lib/commit.tcl b/git-gui/lib/commit.tcl index 83620b7cb..f820c24bf 100644 --- a/git-gui/lib/commit.tcl +++ b/git-gui/lib/commit.tcl @@ -34,9 +34,7 @@ You are currently in the middle of a merge that has not been fully completed. Y lappend parents [string range $line 7 end] } elseif {[string match {encoding *} $line]} { set enc [string tolower [string range $line 9 end]] - } elseif {[regexp "author (.*)\\s<(.*)>\\s(\\d.*$)" $line all name email time]} { - set commit_author [list name $name email $email date $time] - } + } elseif {[regexp "author (.*)\\s<(.*)>\\s(\\d.*$)" $line all name email time]} { } } set msg [read $fd] close $fd @@ -44,7 +42,9 @@ You are currently in the middle of a merge that has not been fully completed. Y set enc [tcl_encoding $enc] if {$enc ne {}} { set msg [encoding convertfrom $enc $msg] + set name [encoding convertfrom $enc $name] } + set commit_author [list name $name email $email date $time] set msg [string trim $msg] } err]} { error_popup [strcat [mc "Error loading commit data for amend:"] "\n\n$err"] -- 2.11.0
Re: [PATCH] git-gui: Prevent double UTF-8 conversion
On Tue, 28 Nov 2017 15:35:21 +0100, Johannes Schindelin wrote: > On Tue, 28 Nov 2017, Łukasz Stelmach wrote: > > With encoding on the file descriptor set to "binary" Tcl (8.6 in my > > case) does double conversion which breaks e.g. author name in amended > > commits. > > Is the problem in question occurring when a commit message contains > non-ASCII characters encoded in UTF-8 and you click the "Amend Last > Commit" radio button on the right side above the "Commit Message" text > box? No, only with the author data. That means there is a difference in how Tcl handles input in with "read" (the message) and "gets" (headers including the author header). Indeed! A few lines below the message is converted from utf-8 and author is not. So the right thing to do is to convert author too and not change the file descriptor settings. I am going back to the drawing board. Thanks. -- Było mi bardzo miło. --- Rurku. --- ... >Łukasz<--- To dobrze, że mnie słuchasz. pgp9ALgHNl0h4.pgp Description: PGP signature
[PATCH] git-gui: Prevent double UTF-8 conversion
Set encoding to utf-8 for file descriptors used to receive data from git commands. With encoding on the file descriptor set to "binary" Tcl (8.6 in my case) does double conversion which breaks e.g. author name in amended commits. For example "\305\201ukasz" (as written by git cat-file) becomes "\303\205\302\201ukasz". Signed-off-by: Łukasz Stelmach <l.stelm...@samsung.com> --- git-gui/lib/commit.tcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) So, this is the second attempt to draw some attention to this patch, since the first one has somewhat failed. https://marc.info/?l=git=150331641702091=2 diff --git a/git-gui/lib/commit.tcl b/git-gui/lib/commit.tcl index 83620b7cb..bcb6499a0 100644 --- a/git-gui/lib/commit.tcl +++ b/git-gui/lib/commit.tcl @@ -26,7 +26,7 @@ You are currently in the middle of a merge that has not been fully completed. Y set parents [list] if {[catch { set fd [git_read cat-file commit $curHEAD] - fconfigure $fd -encoding binary -translation lf + fconfigure $fd -encoding utf-8 -translation lf # By default commits are assumed to be in utf-8 set enc utf-8 while {[gets $fd line] > 0} { -- 2.11.0
[PATCH] git-gui: Prevent double UTF-8 conversion
With encoding on the file descriptor set to "binary" Tcl (8.6 in my case) does double conversion which breaks e.g. author name in amended commits. For example "\305\201ukasz" (as written by git cat-file) becomes "\303\205\302\201ukasz". Signed-off-by: Łukasz Stelmach <l.stelm...@samsung.com> --- git-gui/lib/commit.tcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-gui/lib/commit.tcl b/git-gui/lib/commit.tcl index 83620b7cb..bcb6499a0 100644 --- a/git-gui/lib/commit.tcl +++ b/git-gui/lib/commit.tcl @@ -26,7 +26,7 @@ You are currently in the middle of a merge that has not been fully completed. Y set parents [list] if {[catch { set fd [git_read cat-file commit $curHEAD] - fconfigure $fd -encoding binary -translation lf + fconfigure $fd -encoding utf-8 -translation lf # By default commits are assumed to be in utf-8 set enc utf-8 while {[gets $fd line] > 0} { -- 2.11.0
Re: [PATCH] send-email: support NNTP
It was 2013-04-24 śro 18:17, when Junio C Hamano wrote: l.stelm...@samsung.com (Łukasz Stelmach) writes: It was 2013-04-23 wto 17:02, when Junio C Hamano wrote: Łukasz Stelmach l.stelm...@samsung.com writes: Enable sending patches to NNTP servers (Usenet, Gmane). --- The patch implements support for sending messages to groups on NNTP serviers. Cute. A Perl guru might want to encapsulate the differences between $smtp and $nntp codepaths into two Perl modules, but it looks like a good starting point. You mean *one* perl module like Git::EmailTransport which hides the differences. What I meant was one class to handle SMTP and another for NNTP. You look at the --protocol option, choose one of these classes, and initialize an instance of the chosen class. You can ask the chosen class to instantiate an instance without if/else cascade like this: + +# Transport specific setup +my ($email_authuser, $email_authpass); +if ($email_protocol eq 'nntp') { +$email_authuser = $nntp_authuser; +$email_authuser = $nntp_authuser; +@initial_to = @initial_cc = @bcclist = (); +$to_cmd = $cc_cmd = undef; +$no_cc = $no_bcc = 1; +} else { +$email_authuser = $smtp_authuser; +$email_authpass = $smtp_authpass; +$newsgroups_cmd = undef; +} + [...] OK, I see. Good point. Where would you recommend me to put these modules and how to name them? I mean I don't want to make to much mess here (; -- Łukasz Stelmach Software wizzard Samsung Poland RD Center -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] send-email: support NNTP
It was 2013-04-25 czw 00:41, when Junio C Hamano wrote: Thomas Rast tr...@inf.ethz.ch writes: Łukasz Stelmach l.stelm...@samsung.com writes: Enable sending patches to NNTP servers (Usenet, Gmane). I'm surprised Junio didn't mention this: your patch lacks the Signed-off-by. Heh, that was because I took the patch as an early preview and not a final submission. It came without documentation updates, and also it seemed to break t9001 for whatever reason. I suppose that means I should write tests too. OK. -- Łukasz Stelmach Software wizzard Samsung Poland RD Center -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] send-email: support NNTP
It was 2013-04-24 śro 09:19, when Eric Sunshine wrote: On Tue, Apr 23, 2013 at 7:13 AM, Łukasz Stelmach l.stelm...@samsung.com wrote: Enable sending patches to NNTP servers (Usenet, Gmane). --- diff --git a/git-send-email.perl b/git-send-email.perl index bd13cc8..0356635 100755 --- a/git-send-email.perl +++ b/git-send-email.perl @@ -1174,6 +1249,18 @@ X-Mailer: git-send-email $gitversion if ($dry_run) { # We don't want to send the email. + } elsif ($email_protocol eq 'nntp') { + if (!defined $nntp_server) { + die The requires NNTP server is not properly defined. s/requires/required/ Done. Waiting for more comments. -- Łukasz Stelmach Software wizzard Samsung Poland RD Center Al. Armii Ludowej 26, 00-609 Warszawa http://www.rd.samsung.pl -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] send-email: support NNTP
It was 2013-04-23 wto 17:02, when Junio C Hamano wrote: Łukasz Stelmach l.stelm...@samsung.com writes: Enable sending patches to NNTP servers (Usenet, Gmane). --- The patch implements support for sending messages to groups on NNTP serviers. Cute. A Perl guru might want to encapsulate the differences between $smtp and $nntp codepaths into two Perl modules, but it looks like a good starting point. You mean *one* perl module like Git::EmailTransport which hides the differences. -- Łukasz Stelmach Software wizzard Samsung Poland RD Center Al. Armii Ludowej 26, 00-609 Warszawa http://www.rd.samsung.pl -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] send-email: support NNTP
It was 2013-04-24 śro 09:38, when Thomas Rast wrote: Łukasz Stelmach l.stelm...@samsung.com writes: Enable sending patches to NNTP servers (Usenet, Gmane). I'm surprised Junio didn't mention this: your patch lacks the Signed-off-by. +if ($email_protocol eq 'nntp') { +$header = Newsgroups: $to\n . $header; +} else { +$header = To: $to${ccline}\n . $header; +} Are you silently ignoring any Ccs that have been set if you're in NNTP mode? Yes. Would it be possible to instead send the Ccs by mail as usual, and only the main message over NNTP? (You don't need to run off and implement this, but I'm curious how hard you think it would be.) Currently you choose a code path with --protocol. The message is sent only once. It is possible to iterate over To/Cc/Bcc/Newsgroups and choose send it more than once. There are some tiny nasty bits though, I don't know how to handle. For example: --8---cut here---start-8--- @@ -761,12 +807,21 @@ if (!defined $sender) { } my $prompting = 0; -if (!@initial_to !defined $to_cmd) { + +if ($email_protocol eq 'smtp' !@initial_to !defined $to_cmd) { my $to = ask(Who should the emails be sent to (if any)? , default = , valid_re = qr/\@.*\./, confirm_only = 1); push @initial_to, parse_address_line($to) if defined $to; # sanitized/validated later $prompting++; +} elsif ($email_protocol eq 'nntp' +!@initial_newsgroups +!defined $newsgroups_cmd) { + my $newsgroup = ask(Which newsgroups should the message be sent to (if any)? , +default = , +valid_re = qr/[\x20-\x7f]+/, confirm_only = 1); + push @initial_newsgroups, $newsgroup if defined $newsgroup; # sanitized/validated later + $prompting++; } --8---cut here---end---8--- How to ask interactively where to send the message? With protocol set early it is clear what we are trying to do. Any suggestions? The other issue is that I am not sure (RFC?) if it is OK to send To/Cc/Bcc headers in a NNTP message. Theoretically they should not break things but... At least in the git@vger world with a lot of etiquette surrounding the use of Ccs, NNTP mode isn't very useful if you can't also send Ccs. But maybe you have another use-case where that is not a problem? I've sent this patch vi NNTP :) You've got it. -- Łukasz Stelmach Software wizzard Samsung Poland RD Center -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] send-email: support NNTP
Enable sending patches to NNTP servers (Usenet, Gmane). --- The patch implements support for sending messages to groups on NNTP serviers. The patch does not (attempts not to) change the default behavior i.e. to use sendmail and/or Net::SMTP. To use NNTP one needs to configure the server (see the help message) and protocol (--protocol nntp). Then after giving --newsgroups the message will be sent via NNTP. Like this one: perl git-send-email.perl --protocol nntp --newsgroups gmane.comp.version-control.git --nntp-server news.gmane.org 0001-send-email-support-NNTP.patch git-send-email.perl | 156 +-- 1 file changed, 125 insertions(+), 31 deletions(-) diff --git a/git-send-email.perl b/git-send-email.perl index bd13cc8..0356635 100755 --- a/git-send-email.perl +++ b/git-send-email.perl @@ -54,12 +54,14 @@ git send-email [options] file | directory | rev-list options --[no-]bcc str * Email Bcc: --subject str * Email Subject: --in-reply-to str * Email In-Reply-To: +--newsgroupsstr * NNTP Newsgroups: --[no-]annotate* Review each patch that will be sent in an editor. --compose * Open an editor for introduction. --compose-encoding str * Encoding to assume for introduction. --8bit-encoding str * Encoding to assume 8bit mails if undeclared Sending: +--protocol str * 'smtp' or 'nntp'. Default 'smtp'. --envelope-sender str * Email envelope sender. --smtp-server str:int * Outgoing SMTP server to use. The port is optional. Default 'localhost'. @@ -71,6 +73,12 @@ git send-email [options] file | directory | rev-list options --smtp-ssl * Deprecated. Use '--smtp-encryption ssl'. --smtp-domain str * The domain name sent to HELO/EHLO handshake --smtp-debug0|1 * Disable, enable Net::SMTP debug. +--nntp-server str:int * Outgoing NNTP server to use. The port + is optional. +--nntp-server-port int * Outgoing NNTP server port. +--nntp-user str * Username for NNTP AUTHINFO. +--nntp-pass str * Password for NNTP AUTHINFO. +--nntp-debug0|1 * Disable, enable Net::NNTP debug. Automating: --identity str * Use the sendemail.id options. @@ -138,12 +146,14 @@ sub format_2822_time { my $have_email_valid = eval { require Email::Valid; 1 }; my $have_mail_address = eval { require Mail::Address; 1 }; my $smtp; +my $nntp; my $auth; # Variables we fill in automatically, or via prompting: my (@to,$no_to,@initial_to,@cc,$no_cc,@initial_cc,@bcclist,$no_bcc,@xh, $initial_reply_to,$initial_subject,@files, - $author,$sender,$smtp_authpass,$annotate,$compose,$time); + $author,$sender,$smtp_authpass,$annotate,$compose,$time, + @initial_newsgroups, @newsgroups); my $envelope_sender; @@ -192,7 +202,9 @@ sub do_edit { # Variables with corresponding config settings my ($thread, $chain_reply_to, $suppress_from, $signed_off_by_cc); -my ($to_cmd, $cc_cmd); +my ($to_cmd, $cc_cmd, $newsgroups_cmd); +my ($email_protocol) = 'smtp'; +my ($nntp_server, $nntp_server_port, $nntp_authuser, $nntp_authpass); my ($smtp_server, $smtp_server_port, @smtp_server_options); my ($smtp_authuser, $smtp_encryption); my ($identity, $aliasfiletype, @alias_files, $smtp_domain); @@ -202,6 +214,7 @@ my ($auto_8bit_encoding); my ($compose_encoding); my ($debug_net_smtp) = 0; # Net::SMTP, see send_message() +my ($debug_net_nntp) = 0; # Net::NNTP, see send_message() my $not_set_by_user = true but not set by the user; @@ -235,6 +248,13 @@ my %config_settings = ( from = \$sender, assume8bitencoding = \$auto_8bit_encoding, composeencoding = \$compose_encoding, +nntpserver = \$nntp_server, +nntpserverport = \$nntp_server_port, +nntpuser = \$nntp_authuser, +nntppass = \$nntp_authpass, +protocol = \$email_protocol, +newsgroups = \@initial_newsgroups, +newsgroupscmd = \$newsgroups_cmd, ); my %config_path_settings = ( @@ -291,6 +311,7 @@ my $rc = GetOptions(h = \$help, to-cmd=s = \$to_cmd, no-to = \$no_to, cc=s = \@initial_cc, + cc-cmd=s = \$cc_cmd, no-cc = \$no_cc, bcc=s = \@bcclist, no-bcc = \$no_bcc, @@ -304,11 +325,18 @@ my $rc = GetOptions(h = \$help, smtp-encryption=s = \$smtp_encryption, smtp-debug:i = \$debug_net_smtp, smtp-domain:s = \$smtp_domain, + newsgroups=s = \@initial_newsgroups, + newsgroups-cmd = \$newsgroups_cmd, + nntp-server=s =
[PATCH] gitk: read and write a repository specific configuration file
Enable gitk read and write repository specific configuration file: .git/k if the file exists. To make gitk use the local file simply create one, e.g. with the touch(1) command. This is very useful if one uses different views for different repositories. Now there is no need to store all of them in ~/.gitk and make the views list needlessly long. Signed-off-by: Łukasz Stelmach stl...@poczta.fm --- gitk | 25 ++--- 1 files changed, 14 insertions(+), 11 deletions(-) diff --git a/gitk b/gitk index 379582a..c6b7dc3 100755 --- a/gitk +++ b/gitk @@ -2703,7 +2703,7 @@ proc doprogupdate {} { proc savestuff {w} { global canv canv2 canv3 mainfont textfont uifont tabstop -global stuffsaved findmergefiles maxgraphpct +global stuffsaved findmergefiles maxgraphpct gitdir global maxwidth showneartags showlocalchanges global viewname viewfiles viewargs viewargscmd viewperm nextviewnum global cmitmode wrapcomment datetimeformat limitdiffs @@ -2714,10 +2714,12 @@ proc savestuff {w} { if {$stuffsaved} return if {![winfo viewable .]} return catch { - if {[file exists ~/.gitk-new]} {file delete -force ~/.gitk-new} - set f [open ~/.gitk-new w] + set fn [expr [file exists [file join $gitdir k]] ? \ + {[file join $gitdir k-new]} : {~/.gitk-new}] + if {[file exists $fn]} {file delete -force $fn} + set f [open $fn w] if {$::tcl_platform(platform) eq {windows}} { - file attributes ~/.gitk-new -hidden true + catch {file attributes ~/.gitk-new -hidden true} } puts $f [list set mainfont $mainfont] puts $f [list set textfont $textfont] @@ -2769,7 +2771,7 @@ proc savestuff {w} { } puts $f } close $f - file rename -force ~/.gitk-new ~/.gitk + file rename -force $fn [regsub {\-new$} $fn {}] } set stuffsaved 1 } @@ -11723,7 +11725,14 @@ namespace import ::msgcat::mc ## And eventually load the actual message catalog ::msgcat::mcload $gitk_msgsdir +# check that we can find a .git directory somewhere... +if {[catch {set gitdir [exec git rev-parse --git-dir]}]} { +show_error {} . [mc Cannot find a git repository here.] +exit 1 +} + catch {source ~/.gitk} +catch {source [file join $gitdir k]} parsefont mainfont $mainfont eval font create mainfont [fontflags mainfont] @@ -11740,12 +11749,6 @@ setui $uicolor setoptions -# check that we can find a .git directory somewhere... -if {[catch {set gitdir [exec git rev-parse --git-dir]}]} { -show_error {} . [mc Cannot find a git repository here.] -exit 1 -} - set selecthead {} set selectheadid {} -- 1.7.8.6 -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2] gitk: add a checkbox to control the visibility of tags
Enable hiding of tags displayed in the tree as yellow labels. If a repository is used together with a system like Gerrit there may be quite a lot of tags used to control building and there may be hardly any place left for commit subjects. Signed-off-by: Łukasz Stelmach stl...@poczta.fm --- Rebased onto Paul's repository. gitk | 23 +++ 1 files changed, 15 insertions(+), 8 deletions(-) diff --git a/gitk b/gitk index 379582a..46c1a7c 100755 --- a/gitk +++ b/gitk @@ -1754,7 +1754,7 @@ proc readrefs {} { global tagids idtags headids idheads tagobjid global otherrefids idotherrefs mainhead mainheadid global selecthead selectheadid -global hideremotes +global hideremotes hidetags foreach v {tagids idtags headids idheads otherrefids idotherrefs} { catch {unset $v} @@ -1776,6 +1776,7 @@ proc readrefs {} { set headids($name) $id lappend idheads($id) $name } elseif {[string match tags/* $name]} { + if {$hidetags} continue # this lets refs/tags/foo^{} overwrite refs/tags/foo, # which is what we want since the former is the commit ID set name [string range $name 5 end] @@ -2709,7 +2710,7 @@ proc savestuff {w} { global cmitmode wrapcomment datetimeformat limitdiffs global colors uicolor bgcolor fgcolor diffcolors diffcontext selectbgcolor global autoselect autosellen extdifftool perfile_attrs markbgcolor use_ttk -global hideremotes want_ttk +global hideremotes hidetags want_ttk if {$stuffsaved} return if {![winfo viewable .]} return @@ -2732,6 +2733,7 @@ proc savestuff {w} { puts $f [list set autosellen $autosellen] puts $f [list set showneartags $showneartags] puts $f [list set hideremotes $hideremotes] + puts $f [list set hidetags $hidetags] puts $f [list set showlocalchanges $showlocalchanges] puts $f [list set datetimeformat $datetimeformat] puts $f [list set limitdiffs $limitdiffs] @@ -10924,7 +10926,7 @@ proc create_prefs_page {w} { proc prefspage_general {notebook} { global NS maxwidth maxgraphpct showneartags showlocalchanges global tabstop limitdiffs autoselect autosellen extdifftool perfile_attrs -global hideremotes want_ttk have_ttk +global hideremotes hidetags want_ttk have_ttk set page [create_prefs_page $notebook.general] @@ -10947,6 +10949,9 @@ proc prefspage_general {notebook} { ${NS}::checkbutton $page.hideremotes -text [mc Hide remote refs] \ -variable hideremotes grid x $page.hideremotes -sticky w +${NS}::checkbutton $page.hidetags -text [mc Hide tag labels] \ + -variable hidetags +grid x $page.hidetags -sticky w ${NS}::label $page.ddisp -text [mc Diff display options] grid $page.ddisp - -sticky w -pady 10 @@ -11048,7 +11053,7 @@ proc doprefs {} { global oldprefs prefstop showneartags showlocalchanges global uicolor bgcolor fgcolor ctext diffcolors selectbgcolor markbgcolor global tabstop limitdiffs autoselect autosellen extdifftool perfile_attrs -global hideremotes want_ttk have_ttk +global hideremotes hidetags want_ttk have_ttk set top .gitkprefs set prefstop $top @@ -11057,7 +11062,7 @@ proc doprefs {} { return } foreach v {maxwidth maxgraphpct showneartags showlocalchanges \ - limitdiffs tabstop perfile_attrs hideremotes want_ttk} { + limitdiffs tabstop perfile_attrs hideremotes hidetags want_ttk} { set oldprefs($v) [set $v] } ttk_toplevel $top @@ -11177,7 +11182,7 @@ proc prefscan {} { global oldprefs prefstop foreach v {maxwidth maxgraphpct showneartags showlocalchanges \ - limitdiffs tabstop perfile_attrs hideremotes want_ttk} { + limitdiffs tabstop perfile_attrs hideremotes hidetags want_ttk} { global $v set $v $oldprefs($v) } @@ -11191,7 +11196,7 @@ proc prefsok {} { global oldprefs prefstop showneartags showlocalchanges global fontpref mainfont textfont uifont global limitdiffs treediffs perfile_attrs -global hideremotes +global hideremotes hidetags catch {destroy $prefstop} unset prefstop @@ -11237,7 +11242,8 @@ proc prefsok {} { $limitdiffs != $oldprefs(limitdiffs)} { reselectline } -if {$hideremotes != $oldprefs(hideremotes)} { +if {$hideremotes != $oldprefs(hideremotes) || +$hidetags != $oldprefs(hidetags)} { rereadrefs } } @@ -11661,6 +11667,7 @@ set cmitmode patch set wrapcomment none set showneartags 1 set hideremotes 0 +set hidetags 0 set maxrefs 20 set maxlinelen 200 set showlocalchanges 1 -- 1.7.8.6 -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2] gitk: read and write a repository specific configuration file
Enable gitk read and write repository specific configuration file: .git/k if the file exists. To make gitk use the local file simply create one, e.g. with the touch(1) command. This is very useful if one uses different views for different repositories. Now there is no need to store all of them in ~/.gitk and make the views list needlesly long. Signed-off-by: Łukasz Stelmach stl...@poczta.fm --- Same as before but rebased onto Paul's repository. gitk | 25 ++--- 1 files changed, 14 insertions(+), 11 deletions(-) diff --git a/gitk b/gitk index 379582a..c6b7dc3 100755 --- a/gitk +++ b/gitk @@ -2703,7 +2703,7 @@ proc doprogupdate {} { proc savestuff {w} { global canv canv2 canv3 mainfont textfont uifont tabstop -global stuffsaved findmergefiles maxgraphpct +global stuffsaved findmergefiles maxgraphpct gitdir global maxwidth showneartags showlocalchanges global viewname viewfiles viewargs viewargscmd viewperm nextviewnum global cmitmode wrapcomment datetimeformat limitdiffs @@ -2714,10 +2714,12 @@ proc savestuff {w} { if {$stuffsaved} return if {![winfo viewable .]} return catch { - if {[file exists ~/.gitk-new]} {file delete -force ~/.gitk-new} - set f [open ~/.gitk-new w] + set fn [expr [file exists [file join $gitdir k]] ? \ + {[file join $gitdir k-new]} : {~/.gitk-new}] + if {[file exists $fn]} {file delete -force $fn} + set f [open $fn w] if {$::tcl_platform(platform) eq {windows}} { - file attributes ~/.gitk-new -hidden true + catch {file attributes ~/.gitk-new -hidden true} } puts $f [list set mainfont $mainfont] puts $f [list set textfont $textfont] @@ -2769,7 +2771,7 @@ proc savestuff {w} { } puts $f } close $f - file rename -force ~/.gitk-new ~/.gitk + file rename -force $fn [regsub {\-new$} $fn {}] } set stuffsaved 1 } @@ -11723,7 +11725,14 @@ namespace import ::msgcat::mc ## And eventually load the actual message catalog ::msgcat::mcload $gitk_msgsdir +# check that we can find a .git directory somewhere... +if {[catch {set gitdir [exec git rev-parse --git-dir]}]} { +show_error {} . [mc Cannot find a git repository here.] +exit 1 +} + catch {source ~/.gitk} +catch {source [file join $gitdir k]} parsefont mainfont $mainfont eval font create mainfont [fontflags mainfont] @@ -11740,12 +11749,6 @@ setui $uicolor setoptions -# check that we can find a .git directory somewhere... -if {[catch {set gitdir [exec git rev-parse --git-dir]}]} { -show_error {} . [mc Cannot find a git repository here.] -exit 1 -} - set selecthead {} set selectheadid {} -- 1.7.8.6 -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] gitk: read and write a repository specific configuration file
Enable gitk read and write repository specific configuration file: .git/k if the file exists. To make gitk use the local file simply create one, e.g. with the touch(1) command. This is very useful if one uses different views for different repositories. Now there is no need to store all of them in ~/.gitk and make the views list needlesly long. Signed-off-by: Łukasz Stelmach stl...@poczta.fm --- gitk-git/gitk | 25 ++--- 1 files changed, 14 insertions(+), 11 deletions(-) diff --git a/gitk-git/gitk b/gitk-git/gitk index d93bd99..60cf4cd 100755 --- a/gitk-git/gitk +++ b/gitk-git/gitk @@ -2696,7 +2696,7 @@ proc doprogupdate {} { proc savestuff {w} { global canv canv2 canv3 mainfont textfont uifont tabstop -global stuffsaved findmergefiles maxgraphpct +global stuffsaved findmergefiles maxgraphpct gitdir global maxwidth showneartags showlocalchanges global viewname viewfiles viewargs viewargscmd viewperm nextviewnum global cmitmode wrapcomment datetimeformat limitdiffs @@ -2707,10 +2707,12 @@ proc savestuff {w} { if {$stuffsaved} return if {![winfo viewable .]} return catch { - if {[file exists ~/.gitk-new]} {file delete -force ~/.gitk-new} - set f [open ~/.gitk-new w] + set fn [expr [file exists [file join $gitdir k]] ? \ + {[file join $gitdir k-new]} : {~/.gitk-new}] + if {[file exists $fn]} {file delete -force $fn} + set f [open $fn w] if {$::tcl_platform(platform) eq {windows}} { - file attributes ~/.gitk-new -hidden true + catch {file attributes ~/.gitk-new -hidden true} } puts $f [list set mainfont $mainfont] puts $f [list set textfont $textfont] @@ -2762,7 +2764,7 @@ proc savestuff {w} { } puts $f } close $f - file rename -force ~/.gitk-new ~/.gitk + file rename -force $fn [regsub {\-new$} $fn {}] } set stuffsaved 1 } @@ -11663,7 +11665,14 @@ namespace import ::msgcat::mc ## And eventually load the actual message catalog ::msgcat::mcload $gitk_msgsdir +# check that we can find a .git directory somewhere... +if {[catch {set gitdir [exec git rev-parse --git-dir]}]} { +show_error {} . [mc Cannot find a git repository here.] +exit 1 +} + catch {source ~/.gitk} +catch {source [file join $gitdir k]} parsefont mainfont $mainfont eval font create mainfont [fontflags mainfont] @@ -11680,12 +11689,6 @@ setui $uicolor setoptions -# check that we can find a .git directory somewhere... -if {[catch {set gitdir [exec git rev-parse --git-dir]}]} { -show_error {} . [mc Cannot find a git repository here.] -exit 1 -} - set selecthead {} set selectheadid {} -- 1.7.8.6 -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] gitk: add a checkbox to control the visibility of tags
Enable hiding of tags displayed in the tree as yellow labels. If a repository is used together with a system like Gerrit there may be quite a lot of tags used to control building and there may be hardly any place left for commit subjects. Signed-off-by: Łukasz Stelmach stl...@poczta.fm --- gitk-git/gitk | 23 +++ 1 files changed, 15 insertions(+), 8 deletions(-) diff --git a/gitk-git/gitk b/gitk-git/gitk index d93bd99..274b46b 100755 --- a/gitk-git/gitk +++ b/gitk-git/gitk @@ -1754,7 +1754,7 @@ proc readrefs {} { global tagids idtags headids idheads tagobjid global otherrefids idotherrefs mainhead mainheadid global selecthead selectheadid -global hideremotes +global hideremotes hidetags foreach v {tagids idtags headids idheads otherrefids idotherrefs} { catch {unset $v} @@ -1776,6 +1776,7 @@ proc readrefs {} { set headids($name) $id lappend idheads($id) $name } elseif {[string match tags/* $name]} { + if {$hidetags} continue # this lets refs/tags/foo^{} overwrite refs/tags/foo, # which is what we want since the former is the commit ID set name [string range $name 5 end] @@ -2702,7 +2703,7 @@ proc savestuff {w} { global cmitmode wrapcomment datetimeformat limitdiffs global colors uicolor bgcolor fgcolor diffcolors diffcontext selectbgcolor global autoselect autosellen extdifftool perfile_attrs markbgcolor use_ttk -global hideremotes want_ttk +global hideremotes hidetags want_ttk if {$stuffsaved} return if {![winfo viewable .]} return @@ -2725,6 +2726,7 @@ proc savestuff {w} { puts $f [list set autosellen $autosellen] puts $f [list set showneartags $showneartags] puts $f [list set hideremotes $hideremotes] + puts $f [list set hidetags $hidetags] puts $f [list set showlocalchanges $showlocalchanges] puts $f [list set datetimeformat $datetimeformat] puts $f [list set limitdiffs $limitdiffs] @@ -10864,7 +10866,7 @@ proc create_prefs_page {w} { proc prefspage_general {notebook} { global NS maxwidth maxgraphpct showneartags showlocalchanges global tabstop limitdiffs autoselect autosellen extdifftool perfile_attrs -global hideremotes want_ttk have_ttk +global hideremotes hidetags want_ttk have_ttk set page [create_prefs_page $notebook.general] @@ -10887,6 +10889,9 @@ proc prefspage_general {notebook} { ${NS}::checkbutton $page.hideremotes -text [mc Hide remote refs] \ -variable hideremotes grid x $page.hideremotes -sticky w +${NS}::checkbutton $page.hidetags -text [mc Hide tag labels] \ + -variable hidetags +grid x $page.hidetags -sticky w ${NS}::label $page.ddisp -text [mc Diff display options] grid $page.ddisp - -sticky w -pady 10 @@ -10988,7 +10993,7 @@ proc doprefs {} { global oldprefs prefstop showneartags showlocalchanges global uicolor bgcolor fgcolor ctext diffcolors selectbgcolor markbgcolor global tabstop limitdiffs autoselect autosellen extdifftool perfile_attrs -global hideremotes want_ttk have_ttk +global hideremotes hidetags want_ttk have_ttk set top .gitkprefs set prefstop $top @@ -10997,7 +11002,7 @@ proc doprefs {} { return } foreach v {maxwidth maxgraphpct showneartags showlocalchanges \ - limitdiffs tabstop perfile_attrs hideremotes want_ttk} { + limitdiffs tabstop perfile_attrs hideremotes hidetags want_ttk} { set oldprefs($v) [set $v] } ttk_toplevel $top @@ -7,7 +11122,7 @@ proc prefscan {} { global oldprefs prefstop foreach v {maxwidth maxgraphpct showneartags showlocalchanges \ - limitdiffs tabstop perfile_attrs hideremotes want_ttk} { + limitdiffs tabstop perfile_attrs hideremotes hidetags want_ttk} { global $v set $v $oldprefs($v) } @@ -11131,7 +11136,7 @@ proc prefsok {} { global oldprefs prefstop showneartags showlocalchanges global fontpref mainfont textfont uifont global limitdiffs treediffs perfile_attrs -global hideremotes +global hideremotes hidetags catch {destroy $prefstop} unset prefstop @@ -11177,7 +11182,8 @@ proc prefsok {} { $limitdiffs != $oldprefs(limitdiffs)} { reselectline } -if {$hideremotes != $oldprefs(hideremotes)} { +if {$hideremotes != $oldprefs(hideremotes) || +$hidetags != $oldprefs(hidetags)} { rereadrefs } } @@ -11601,6 +11607,7 @@ set cmitmode patch set wrapcomment none set showneartags 1 set hideremotes 0 +set hidetags 0 set maxrefs 20 set maxlinelen 200 set showlocalchanges 1 -- 1.7.8.6 -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html