Re: [RFC PATCH] Introduce "precious" file concept
On Sun, Nov 11, 2018 at 10:53 AM Nguyễn Thái Ngọc Duy wrote: > > Also while "precious" is a fun name, but it does not sound serious. > Any suggestions? Perhaps "valuable"? "precious" is also used by POSIX make: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/make.html Bert
Re: git-gui ignores core.hooksPath
On Wed, Apr 11, 2018 at 12:50 AM, Junio C Hamano wrote: > Chris Maes writes: > >> Is there any hope from here that anyone will pick up this / these >> changes? Will anyone else be assigned the main responsible for this >> git-gui repository? >> >> Just hoping to revive the discussion here, since the >> https://github.com/patthoyts/git-gui/ repository seems quite dead. > > It indeed does. > > I've played a patch-monkey in the past for git-gui and have a few > topics queued still in my tree, but that serves merely as a bookmark > that is slightly better than a pointer to the mailing list archive. > > We need a volunteer to take over this part of the subsystem; > somebody who actually uses it, passionate about improving it, and > can speak tcl/tk somewhat fluently (I qualify none of these three > criteria myself). > > Any takers? the last time this topic came up, Stefan (in Cc) offered to volunteer. Stefan, is this offer still open? I would support this. Best,
Re: [PATCH] gitk: do not limit tree mode listing in the file list panel to current sub-directory
Thanks. On Wed, May 9, 2018 at 12:59 PM, Alex Riesen <alexander.rie...@cetitec.com> wrote: > From: Alex Riesen <raa.l...@gmail.com> > > The previous behavior conflicts with the "Patch" mode of the panel, > which always shows the changes from the top-level of the repository. > It is also impossible to get back to the full listing without restarting > gitk. > --- > > Bert Wesarg, Wed, May 09, 2018 09:19:55 +0200: >> > Frankly, this listing limited to just a sub-directory confuses me a bit. Is >> > there anyway to get to display full repository without changing to the top >> > level? >> >> I noticed that too, while testing your patch and I'm also confused. >> But was not able to send a request to Paul yet. ls-tree --full-tree >> seems to be one that should be used here, I think. > > Well, I just tried your suggestion. 'ls-files' doesn't have --full-tree, so > for those it is just cd-up. > > It is on top of the re-sent series. I would consider the current behavior as a bug, therefor I would put this patch first, and than your other fixes/enhancements. > > gitk | 18 +- > 1 file changed, 9 insertions(+), 9 deletions(-) > > diff --git a/gitk b/gitk > index c430dfe..03ead98 100755 > --- a/gitk > +++ b/gitk > @@ -7600,18 +7600,18 @@ proc go_to_parent {i} { > > proc gettree {id} { > global treefilelist treeidlist diffids diffmergeid treepending > -global nullid nullid2 > +global nullid nullid2 cdup > > set diffids $id > unset -nocomplain diffmergeid > if {![info exists treefilelist($id)]} { > if {![info exists treepending]} { > if {$id eq $nullid} { > - set cmd [list | git ls-files] > + set cmd [list | git -C $cdup ls-files] > } elseif {$id eq $nullid2} { > - set cmd [list | git ls-files --stage -t] > + set cmd [list | git -C $cdup ls-files --stage -t] > } else { > - set cmd [list | git ls-tree -r $id] > + set cmd [list | git ls-tree --full-tree -r $id] > } > if {[catch {set gtf [open $cmd r]}]} { > return > @@ -7670,7 +7670,7 @@ proc gettreeline {gtf id} { > proc showfile {f} { > global treefilelist treeidlist diffids nullid nullid2 > global ctext_file_names ctext_file_lines > -global ctext commentend > +global ctext commentend cdup > > set submodlog "log --format=%h\\ %aN:\\ %s -100" > set fcmt "" > @@ -7680,15 +7680,15 @@ proc showfile {f} { > return > } > if {$diffids eq $nullid} { > - if {[file isdirectory $f]} { > + if {[file isdirectory "$cdup$f"]} { > # a submodule > - set qf [shellquote $f] > + set qf [shellquote "$cdup$f"] > if {[catch {set bf [open "| git -C $qf $submodlog" r]} err]} { > puts "oops, can't read submodule $f: $err" > return > } > } else { > - if {[catch {set bf [open $f r]} err]} { > + if {[catch {set bf [open "$cdup$f" r]} err]} { > puts "oops, can't read $f: $err" > return > } > @@ -7704,7 +7704,7 @@ proc showfile {f} { > } > } else { > # also a submodule > - set qf [shellquote $f] > + set qf [shellquote "$cdup$f"] > if {[catch {set bf [open "| git -C $qf $submodlog $blob" r]} > err]} { > puts "oops, error reading submodule commit: $err" > return > -- > 2.17.0.593.g2029711e64 > > > --- > Diese E-Mail wurde von Avast Antivirus-Software auf Viren geprüft. > https://www.avast.com/antivirus >
Re: [PATCH 2/2] gitk: add an option to run gitk on an item in the file list
On Tue, May 8, 2018 at 3:39 PM, Alex Riesen <alexander.rie...@cetitec.com> wrote: > Bert Wesarg, Tue, May 08, 2018 15:17:03 +0200: >> On Tue, May 8, 2018 at 2:22 PM, Alex Riesen <alexander.rie...@cetitec.com> >> wrote: >> > +proc flist_gitk {} { >> > +global flist_menu_file findstring gdttype >> > + >> > +set x [shellquote $flist_menu_file] >> >> this needs to handle cdup, i.e., if gitk is run from a subdirectory, >> all paths needs to be prefixed with $cdup, like: [file join $cdup >> $flist_menu_file] > > That, indeed, is easily done: > > set x [shellquote [file join $cdup $flist_menu_file]] > if {[file isdirectory $flist_menu_file]} { > exec sh -c "cd $x&" & > } else { > exec gitk -- $x & > } > > > It just doesn't seem to work: gitk does not find any commits! > Maybe that's because the file panel lists only files for the current > subdirectory (without the path from the repo top-level)? E.g. > > mkdir tst > cd tst > git init > mkdir a > touch top-file a/sub-file > git add -A ; git commit -m. > cd a > gitk > > Gitk lists only sub-file. > > Frankly, this listing limited to just a sub-directory confuses me a bit. Is > there anyway to get to display full repository without changing to the top > level? I noticed that too, while testing your patch and I'm also confused. But was not able to send a request to Paul yet. ls-tree --full-tree seems to be one that should be used here, I think. Bert
Re: [PATCH 2/2] gitk: add an option to run gitk on an item in the file list
On Tue, May 8, 2018 at 2:22 PM, Alex Riesenwrote: > From: Alex Riesen > > Similar to a git gui feature which visualizes history in a submodule, > the submodules cause the gitk be started inside the submodule. > > Signed-off-by: Alex Riesen > --- > gitk | 12 > 1 file changed, 12 insertions(+) > > diff --git a/gitk b/gitk > index d34833f..1ec545e 100755 > --- a/gitk > +++ b/gitk > @@ -2682,6 +2682,7 @@ proc makewindow {} { > {mc "External diff" command {external_diff}} > {mc "Blame parent commit" command {external_blame 1}} > {mc "Copy path" command {clipboard clear; clipboard append > $flist_menu_file}} > + {mc "Run gitk on this" command {flist_gitk}} > } > $flist_menu configure -tearoff 0 > > @@ -3555,6 +3556,17 @@ proc flist_hl {only} { > set gdttype [mc "touching paths:"] > } > > +proc flist_gitk {} { > +global flist_menu_file findstring gdttype > + > +set x [shellquote $flist_menu_file] this needs to handle cdup, i.e., if gitk is run from a subdirectory, all paths needs to be prefixed with $cdup, like: [file join $cdup $flist_menu_file] Bert > +if {[file isdirectory $flist_menu_file]} { > + exec sh -c "cd $x&" & > +} else { > + exec gitk -- $x & > +} > +} > + > proc gitknewtmpdir {} { > global diffnum gitktmpdir gitdir env >
includeIf breaks calling dashed externals
Dear Duy, heaving an includeIf in a git config file breaks calling external git commands, most prominently git-gui. $ git --version git version 2.12.2.599.gcf11a6797 $ git rev-parse --is-inside-work-tree true $ git echo git: 'echo' is not a git command. See 'git --help'. Did you mean this? fetch $ echo '[includeIf "gitdir:does-not-exists"]path = does-not-exists' >>.git/config $ git rev-parse --is-inside-work-tree true $ git echo fatal: BUG: setup_git_env called without repository Best, Bert
Re: [RFC][Git GUI] Make Commit message field in git GUI re sizable.
HI, the reason why it is fixed, is because commit messages should be wrapped at 76 characters to be used in mails. So it helps you with the wrapping. Bert On Wed, Feb 22, 2017 at 10:27 AM, Jessie Hernandezwrote: > Hi all, > > I have been using git for a few years now and really like the software. > I have a small annoyance and was wondering if I could get the communities > view on this. > > When using git GUI I find it handy to be able to re-size the "Unstaged > Changes" and the "Staged Changed" fields. > > I would like the same thing for the "Commit Message" field, or to have it > re-size with the git GUI window. > > I can re-size the "Commit Message" vertically when making the "Modified" > panel smaller. > > Does this make sense? > I would be happy to get into more detail if that is necessary or if > something is not clear. > > Thank you. > > - > Jessie Hernandez > >
Re: [wish] Revert changes in git gui
On Fri, Dec 12, 2014 at 9:27 AM, Christoph Grüninger f...@grueninger.de wrote: Hi Bert, your commit is more than half a year old. Do you intent to include that into Git master? If not, what's the reason? Thats a really odd question to a person who posted this patch to the mailling list the fist place, isn't it? If anything you should have asked the git gui developers and community, why they didn't show interest to have this in master, right? Bert Bye Christoph -- 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: [wish] Revert changes in git gui
On Tue, Dec 9, 2014 at 9:21 PM, Johannes Sixt j...@kdbg.org wrote: Am 09.12.2014 um 20:49 schrieb Christoph Grüninger: While browsing the changes, it is very easy to add (or remove) lines or hunks for commit via the context menu. I would like to revert the changes of a line or a hunk in a similar way. I have often white-space or formatting changes I don't want to commit but want them reverted immediately. I'm using this patch series since it was posted: http://thread.gmane.org/gmane.comp.version-control.git/188170/focus=188171 Maybe this is easier to apply: http://repo.or.cz/w/git-gui/bertw.git/commit/5d7a81b626c34a94c6c43937d8a64572b6231196 Bert -- 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 15/18] the beginning of the signed push
On Wed, Aug 20, 2014 at 12:06 AM, Junio C Hamano gits...@pobox.com wrote: The basic flow based on this mechanism goes like this: 1. You push out your work with git push -s. 2. The sending side learns where the remote refs are as usual, together with what protocol extension the receiving end supports. If the receiving end does not advertise the protocol extension push-cert, the sending side falls back to the normal push that is not signed. Is this fallback silently? If so I think it would be better to abort the push, if the receiver does not support this but the user requested it. Bert -- 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 5/5] Add a little script to compare two make perf runs
Hi, On Sat, Jul 5, 2014 at 1:43 AM, Andi Kleen a...@firstfloor.org wrote: From: Andi Kleen a...@linux.intel.com Signed-off-by: Andi Kleen a...@linux.intel.com --- diff-res | 26 ++ 1 file changed, 26 insertions(+) create mode 100755 diff-res diff --git a/diff-res b/diff-res new file mode 100755 index 000..90d57be --- /dev/null +++ b/diff-res @@ -0,0 +1,26 @@ +#!/usr/bin/python +# compare two make perf output file +# this should be the results only without any header +import argparse +import math, operator +from collections import OrderedDict + +ap = argparse.ArgumentParser() +ap.add_argument('file1', type=argparse.FileType('r')) +ap.add_argument('file2', type=argparse.FileType('r')) +args = ap.parse_args() + +cmp = (OrderedDict(), OrderedDict()) +for f, k in zip((args.file1, args.file2), cmp): +for j in f: +num = j[59:63] +name = j[:59] +k[name] = float(num) + +for j in cmp[0].keys(): +print j, cmp[1][j] - cmp[0][j] + +def geomean(l): + return math.pow(reduce(operator.mul, filter(lambda x: x != 0.0, l)), 1.0 / len(l)) + +print geomean %.2f - %.2f % (geomean(cmp[0].values()), geomean(cmp[1].values())) a justification why the geometric mean is used here would increase my confident significantly. It calculates wrong values anyway iff there are zeros in the sampling set. Thanks. Bert -- 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 5/5] Add a little script to compare two make perf runs
On Sun, Jul 6, 2014 at 6:15 PM, Andi Kleen a...@linux.intel.com wrote: a justification why the geometric mean is used here would increase my confident significantly. It's just a standard way to summarize sets of benchmarks. For example SPEC uses the same approach. No, SPEC would have calculated the geometric mean of the ratios cmp[1][j] / cmp[0][j]. And this should also only be used under the assumption that there is a multiplicative correlation. Bert -- 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] remote-http: use argv-array
On Tue, Jul 9, 2013 at 7:18 AM, Junio C Hamano gits...@pobox.com wrote: Instead of using a hand-managed argument array, use argv-array API to manage dynamically formulated command line. Signed-off-by: Junio C Hamano gits...@pobox.com --- remote-curl.c | 31 +++ 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/remote-curl.c b/remote-curl.c index 60eda63..884b3a3 100644 --- a/remote-curl.c +++ b/remote-curl.c @@ -7,6 +7,7 @@ #include run-command.h #include pkt-line.h #include sideband.h +#include argv-array.h static struct remote *remote; static const char *url; /* always ends with a trailing slash */ @@ -787,36 +788,34 @@ static int push_dav(int nr_spec, char **specs) static int push_git(struct discovery *heads, int nr_spec, char **specs) { struct rpc_state rpc; - const char **argv; - int argc = 0, i, err; + int i, err; + struct argv_array args; + + argv_array_init(args); + argv_array_pushl(args, send-pack, --stateless-rpc, --helper-status); missing NULL sentinel. GCC has the 'sentinel' [1] attribute to catch such errors. Or use macro magic: void argv_array_pushl_(struct argv_array *array, ...); #define argv_array_pushl(array, ...) argv_array_pushl_(array, __VA_ARGS__, NULL) Bert [1] http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html#index-g_t_0040code_007bsentinel_007d-function-attribute-2708 -- 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 1/7] shorten_unambiguous_ref(): Allow shortening refs/remotes/origin/HEAD to origin
On Sun, May 5, 2013 at 1:55 AM, Johan Herland jo...@herland.net wrote: When expanding shorthand refs to full ref names (e.g. in dwim_ref()), we use the ref_rev_parse_rules list of expansion patterns. This list allows origin to be expanded into refs/remotes/origin/HEAD, by using the refs/remotes/%.*s/HEAD pattern from that list. shorten_unambiguous_ref() exists to provide the reverse operation: turning a full ref name into a shorter (but still unambiguous) name. It does so by matching the given refname against each pattern from the ref_rev_parse_rules list (in reverse), and extracting the short- hand name from the matching rule. However, when given refs/remotes/origin/HEAD it fails to shorten it into origin, because we misuse the sscanf() function when matching refs/remotes/origin/HEAD against refs/remotes/%.*s/HEAD: We end up calling sscanf like this: sscanf(refs/remotes/origin/HEAD, refs/remotes/%s/HEAD, short_name) In this case, sscanf() will match the initial refs/remotes/ part, and then match the remainder of the refname against the %s, and place it (origin/HEAD) into short_name. The part of the pattern following the %s format is never verified, because sscanf() apparently does not need to do that (it has performed the one expected format extraction, and will return 1 correspondingly; see [1] for more details). This patch replaces the misuse of sscanf() with a fairly simple function that manually matches the refname against patterns, and extracts the shorthand name. Also a testcase verifying refs/remotes/origin/HEAD - origin has been added. [1]: If we assume that sscanf() does not do a verification pass prior to format extraction, there is AFAICS _no_ way for sscanf() - having already done one or more format extractions - to indicate to its caller that the input fails to match the trailing part of the format string. In other words, AFAICS, the scanf() family of function will only verify matching input up to and including the last format specifier in the format string. Any data following the last format specifier will not be verified. Yet another reason to consider the scanf functions harmful... Cc: Bert Wesarg bert.wes...@googlemail.com Looks good, thanks. Reviewed-by: Bert Wesarg bert.wes...@googlemail.com Signed-off-by: Johan Herland jo...@herland.net --- refs.c | 82 +++-- t/t6300-for-each-ref.sh | 12 2 files changed, 43 insertions(+), 51 deletions(-) diff --git a/refs.c b/refs.c index d17931a..7231f54 100644 --- a/refs.c +++ b/refs.c @@ -2945,80 +2945,60 @@ struct ref *find_ref_by_name(const struct ref *list, const char *name) return NULL; } -/* - * generate a format suitable for scanf from a ref_rev_parse_rules - * rule, that is replace the %.*s spec with a %s spec - */ -static void gen_scanf_fmt(char *scanf_fmt, const char *rule) +int shorten_ref(const char *refname, const char *pattern, char *short_name) { - char *spec; - - spec = strstr(rule, %.*s); - if (!spec || strstr(spec + 4, %.*s)) - die(invalid rule in ref_rev_parse_rules: %s, rule); - - /* copy all until spec */ - strncpy(scanf_fmt, rule, spec - rule); - scanf_fmt[spec - rule] = '\0'; - /* copy new spec */ - strcat(scanf_fmt, %s); - /* copy remaining rule */ - strcat(scanf_fmt, spec + 4); - - return; + /* +* pattern must be of the form [pre]%.*s[post]. Check if refname +* starts with [pre] and ends with [post]. If so, write the +* middle part into short_name, and return the number of chars +* written (not counting the added NUL-terminator). Otherwise, +* if refname does not match pattern, return 0. +*/ + size_t pre_len, post_start, post_len, match_len; + size_t ref_len = strlen(refname); + char *sep = strstr(pattern, %.*s); + if (!sep || strstr(sep + 4, %.*s)) + die(invalid pattern in ref_rev_parse_rules: %s, pattern); + pre_len = sep - pattern; + post_start = pre_len + 4; + post_len = strlen(pattern + post_start); + if (pre_len + post_len = ref_len) + return 0; /* refname too short */ + match_len = ref_len - (pre_len + post_len); + if (strncmp(refname, pattern, pre_len) || + strncmp(refname + ref_len - post_len, pattern + post_start, post_len)) + return 0; /* refname does not match */ + memcpy(short_name, refname + pre_len, match_len); + short_name[match_len] = '\0'; + return match_len; } char *shorten_unambiguous_ref(const char *refname, int strict) { int i; - static char **scanf_fmts; - static int nr_rules; char *short_name; - /* pre generate scanf formats from ref_rev_parse_rules[] */ - if (!nr_rules) { - size_t
Re: [PATCH] git-gui: Fix semi-working shortcuts for unstage and revert
On Sat, Sep 15, 2012 at 1:36 AM, vi0...@gmail.com wrote: From: Vitaly _Vi Shukela vi0...@gmail.com Make Ctrl+U for unstaging and Ctrl+J for reverting selection behave more like Ctrl+T for adding. They were working only when one area was focused (diff or commit message), now they should work everywhere. Signed-off-by: Vitaly _Vi Shukela vi0...@gmail.com --- Sending the patch the third time (haven't got any replies to previous two attempts). For what its worth: Acked-by: Bert Wesarg bert.wes...@googlemail.com But unless Pat reacts this is useless. Bert git-gui/git-gui.sh |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh index ba4e5c1..6618016 100755 --- a/git-gui/git-gui.sh +++ b/git-gui/git-gui.sh @@ -3710,6 +3710,8 @@ bind $ui_diff $M1B-Key-v {break} bind $ui_diff $M1B-Key-V {break} bind $ui_diff $M1B-Key-a {%W tag add sel 0.0 end;break} bind $ui_diff $M1B-Key-A {%W tag add sel 0.0 end;break} +bind $ui_diff $M1B-Key-j {do_revert_selection;break} +bind $ui_diff $M1B-Key-J {do_revert_selection;break} bind $ui_diff Key-Up {catch {%W yview scroll -1 units};break} bind $ui_diff Key-Down {catch {%W yview scroll 1 units};break} bind $ui_diff Key-Left {catch {%W xview scroll -1 units};break} @@ -3742,6 +3744,8 @@ bind . $M1B-Key-s do_signoff bind . $M1B-Key-S do_signoff bind . $M1B-Key-t do_add_selection bind . $M1B-Key-T do_add_selection +bind . $M1B-Key-u do_unstage_selection +bind . $M1B-Key-U do_unstage_selection bind . $M1B-Key-j do_revert_selection bind . $M1B-Key-J do_revert_selection bind . $M1B-Key-i do_add_all -- 1.7.8.5 -- 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