* Re: [PATCH v2 01/10] sequencer.c: remove broken support for rfc2822 continuation in footer
From: Jonathan Nieder @ 2013-01-22 10:21 UTC (permalink / raw)
To: Brandon Casey; +Cc: gitster, pclouds, git, Brandon Casey
In-Reply-To: <20130122101208.GC8908@elie.Belkin>
Jonathan Nieder wrote:
> line) instead of buf[i] is a whitespace character. So for example, it
> confuses the following for a well-formed RFC2822 footer:
Luckily it doesn't, since the final continuation line is not followed
by whitespace. I should have said:
"... is a whitespace character. The result is that any
footer with a continuation line is not accepted, since the last
continuation line neither starts with an RFC2822 field name nor is
followed by a continuation line.
That this has remained broken for so long is good evidence that nobody
actually needed multiline fields. Rip out the broken continuation
support.
No functional change intended."
I have no excuse, since you explained this all out loud to me a couple of
months ago. :) Sorry for the nonsense.
Thanks,
Jonathan
^ permalink raw reply
* Re: [PATCH v2 01/10] sequencer.c: remove broken support for rfc2822 continuation in footer
From: Brandon Casey @ 2013-01-22 11:08 UTC (permalink / raw)
To: Jonathan Nieder; +Cc: gitster, pclouds, git, Brandon Casey
In-Reply-To: <20130122094916.GB8908@elie.Belkin>
On Tue, Jan 22, 2013 at 1:49 AM, Jonathan Nieder <jrnieder@gmail.com> wrote:
> Jonathan Nieder wrote:
>
>> Here is the loop in master:
>>
>> int hit = 0;
>> [...]
>>
>> for (i = len - 1; i > 0; i--) {
>> if (hit && buf[i] == '\n')
>> break;
>> hit = (buf[i] == '\n');
>> }
>>
>> I don't see any adjacency check.
>
> Of course that's because I can't read. :) Checking again.
Blame the code, not your eyes. The use of the term 'hit' is what
makes this loop confusing. It gives the impression that 'hit' gets
set once, after the first newline is /hit/.
It would be much easier to read if it was written like this:
int last_char_was_nl = 0;
for (i = len - 1; i > 0; i--) {
this_char_is_nl = (buf[i] == '\n');
if (last_char_was_nl && this_char_is_nl)
break;
last_char_was_nl = this_char_is_nl;
}
I'll slide this in when I resubmit this series with your suggestions.
-Brandon
^ permalink raw reply
* branch name in remote.<remote>.push is not updated after "git branch -m"
From: Andrey Borzenkov @ 2013-01-22 12:43 UTC (permalink / raw)
To: git
I renamed branches and noticed that branch name was not changed in
remote push config. I.e. after
bor@opensuse:~/src/bootinfoscript> git branch -m github master
I still have
[remote "github"]
push = github:master
url = git://github.com/arvidjaar/bootinfoscript.git
pushurl = git@github.com:arvidjaar/bootinfoscript.git
fetch = +refs/heads/*:refs/remotes/github/*
Is it expected behavior or possibly already fixed?
bor@opensuse:~> git --version
git version 1.7.10.4
TIA
-andrey
^ permalink raw reply
* gitk show branch in commit overview
From: Teun Grinwis @ 2013-01-22 13:45 UTC (permalink / raw)
To: git; +Cc: paulus
In-Reply-To: <50FE70F0.8020600@adesys.nl>
[-- Attachment #1: Type: text/plain, Size: 1096 bytes --]
> Hello,
> We recently changed from using CVS to GIT, previous company I worked
> we used clearcase.
>
> We do feature development / bug fixing (complex) on branches, trivial
> changes commit direct on Develop branch.
>
> What I am missing in all the gui tools is the relation on what
> specific branch did one do a commit.
>
> I searched on the internet and read that there is need to see on
> which branch a specific commit is done.
>
> From the link below,
> https://github.com/pajp/git/compare/master...x-working-branch
> I tried this version, but could not see the branches when I started
> gitk in a git repository,
> so I looked into his changes, and adapted his code with use of the git
> commands
> git show-branch --all and git show-branch --all --sha1name.
> And see the result below:
>
--
Met vriendelijke groeten / With kind regards,
Teun Grinwis
Software engineer
Adesys B.V.
Molenweer 4, 2291 NR, Wateringen, NL.
P.O. Box 60, 2290 AB, Wateringen, NL.
Tfn : +31 174 296389
Fax : +31 174 293807
e-mail : teun@adesys.nl
internet : www.adesys.nl
[-- Attachment #2: 0001-show-branch-canvas-in-commit-overview.patch --]
[-- Type: text/plain, Size: 8220 bytes --]
>From 15427e2dc35c58ab2ad7e9466aa280f5c70e9eda Mon Sep 17 00:00:00 2001
From: Teun Grinwis <teun@adesys.nl>
Date: Tue, 22 Jan 2013 11:43:39 +0100
Subject: [PATCH] show branch canvas in commit overview
---
gitk | 91 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------
1 file changed, 79 insertions(+), 12 deletions(-)
diff --git a/gitk b/gitk
index b3706fc..cdde3b2 100755
--- a/gitk
+++ b/gitk
@@ -496,7 +496,9 @@ proc updatecommits {} {
global hasworktree
global varcid vposids vnegids vflags vrevs
global show_notes
+ global workbranches_set
+ set workbranches_set false
set hasworktree [hasworktree]
rereadrefs
set view $curview
@@ -577,7 +579,9 @@ proc reloadcommits {} {
global curview viewcomplete selectedline currentid thickerline
global showneartags treediffs commitinterest cached_commitrow
global targetid
+ global workbranches_set
+ set workbranches_set false
set selid {}
if {$selectedline ne {}} {
set selid $currentid
@@ -1652,6 +1656,50 @@ proc readcommit {id} {
parsecommit $id $contents 1
}
+set workbranches_set false
+
+proc set_workbranches { } {
+ global workbranches
+
+ catch {set allbranches [exec git show-branch --all]}
+ catch {set allsha1names [exec git show-branch --all --sha1-name]}
+
+ set allbranches [split $allbranches \n\n]
+ set allsha1names [split $allsha1names \n\n]
+
+ foreach br $allbranches sha1 $allsha1names {
+
+ set branch [lindex [split $br "\["] 1 ]
+ set branch [lindex [split $branch "]"] 0 ]
+ set branch [lindex [split $branch "~"] 0 ]
+ set branch [lindex [split $branch "^"] 0 ]
+
+ set sha1Id [lindex [split $sha1 "\["] 1 ]
+ set sha1Id [lindex [split $sha1Id "]"] 0 ]
+ set workbranches($sha1Id) $branch
+ }
+}
+
+proc get_workbranch { shaid } {
+
+ global workbranches workbranches_set
+ set workbranch ""
+
+# use 1st 7 digits of shaid
+ set shaid [string range $shaid 0 6]
+
+ if { $workbranches_set == false } {
+ set_workbranches
+ set workbranches_set true
+ }
+
+ if { [ info exist workbranches($shaid) ] } {
+ return $workbranches($shaid)
+ } else {
+ return "unknown"
+ }
+}
+
proc parsecommit {id contents listed} {
global commitinfo
@@ -1662,6 +1710,7 @@ proc parsecommit {id contents listed} {
set audate {}
set comname {}
set comdate {}
+ set workbranch {}
set hdrend [string first "\n\n" $contents]
if {$hdrend < 0} {
# should never happen...
@@ -1703,9 +1752,11 @@ proc parsecommit {id contents listed} {
}
set comment $newcomment
}
+ set workbranch [get_workbranch $id]
set hasnote [string first "\nNotes:\n" $contents]
set commitinfo($id) [list $headline $auname $audate \
- $comname $comdate $comment $hasnote]
+ $comname $comdate $comment $hasnote $workbranch]
+
}
proc getcommit {id} {
@@ -2015,7 +2066,7 @@ proc makedroplist {w varname args} {
}
proc makewindow {} {
- global canv canv2 canv3 linespc charspc ctext cflist cscroll
+ global canv canv2 canv3 canv4 linespc charspc ctext cflist cscroll
global tabstop
global findtype findtypemenu findloc findstring fstring geometry
global entries sha1entry sha1string sha1but
@@ -2109,7 +2160,7 @@ proc makewindow {} {
.tf.histframe.pwclist configure -sashpad 0 -handlesize 4
}
- # create three canvases
+ # create four canvases
set cscroll .tf.histframe.csb
set canv .tf.histframe.pwclist.canv
canvas $canv \
@@ -2127,6 +2178,11 @@ proc makewindow {} {
-selectbackground $selectbgcolor \
-background $bgcolor -bd 0 -yscrollincr $linespc
.tf.histframe.pwclist add $canv3
+ set canv4 .tf.histframe.pwclist.canv4
+ canvas $canv4 \
+ -selectbackground $selectbgcolor \
+ -background $bgcolor -bd 0 -yscrollincr $linespc
+ .tf.histframe.pwclist add $canv4
if {$use_ttk} {
bind .tf.histframe.pwclist <Map> {
bind %W <Map> {}
@@ -2602,11 +2658,11 @@ proc makewindow {} {
# the one where the mouse hovers, so bind those events here and redirect
# to the correct window
proc windows_mousewheel_redirector {W X Y D} {
- global canv canv2 canv3
+ global canv canv2 canv3 canv4
set w [winfo containing -displayof $W $X $Y]
if {$w ne ""} {
set u [expr {$D < 0 ? 5 : -5}]
- if {$w == $canv || $w == $canv2 || $w == $canv3} {
+ if {$w == $canv || $w == $canv2 || $w == $canv3 || $w == $canv4} {
allcanvs yview scroll $u units
} else {
catch {
@@ -2715,7 +2771,7 @@ proc doprogupdate {} {
}
proc savestuff {w} {
- global canv canv2 canv3 mainfont textfont uifont tabstop
+ global canv canv2 canv3 canv4 mainfont textfont uifont tabstop
global stuffsaved findmergefiles maxgraphpct
global maxwidth showneartags showlocalchanges
global viewname viewfiles viewargs viewargscmd viewperm nextviewnum
@@ -2859,17 +2915,19 @@ proc resizecdetpanes {win w} {
}
proc allcanvs args {
- global canv canv2 canv3
+ global canv canv2 canv3 canv4
eval $canv $args
eval $canv2 $args
eval $canv3 $args
+ eval $canv4 $args
}
proc bindall {event action} {
- global canv canv2 canv3
+ global canv canv2 canv3 canv4
bind $canv $event $action
bind $canv2 $event $action
bind $canv3 $event $action
+ bind $canv4 $event $action
}
proc about {} {
@@ -4997,13 +5055,14 @@ proc initlayout {} {
}
proc setcanvscroll {} {
- global canv canv2 canv3 numcommits linespc canvxmax canvy0
+ global canv canv2 canv3 canv4 numcommits linespc canvxmax canvy0
global lastscrollset lastscrollrows
set ymax [expr {$canvy0 + ($numcommits - 0.5) * $linespc + 2}]
$canv conf -scrollregion [list 0 0 $canvxmax $ymax]
$canv2 conf -scrollregion [list 0 0 0 $ymax]
$canv3 conf -scrollregion [list 0 0 0 $ymax]
+ $canv4 conf -scrollregion [list 0 0 0 $ymax]
set lastscrollset [clock clicks -milliseconds]
set lastscrollrows $numcommits
}
@@ -5919,7 +5978,7 @@ proc drawlines {id} {
}
proc drawcmittext {id row col} {
- global linespc canv canv2 canv3 fgcolor curview
+ global linespc canv canv2 canv3 canv4 fgcolor curview
global cmitlisted commitinfo rowidlist parentlist
global rowtextx idpos idtags idheads idotherrefs
global linehtag linentag linedtag selectedline
@@ -5986,6 +6045,7 @@ proc drawcmittext {id row col} {
set headline [lindex $commitinfo($id) 0]
set name [lindex $commitinfo($id) 1]
set date [lindex $commitinfo($id) 2]
+ set workbranch [lindex $commitinfo($id) 7]
set date [formatdate $date]
set font mainfont
set nfont mainfont
@@ -6001,9 +6061,12 @@ proc drawcmittext {id row col} {
set linehtag($id) [$canv create text $xt $y -anchor w -fill $fgcolor \
-text $headline -font $font -tags text]
$canv bind $linehtag($id) $ctxbut "rowmenu %X %Y $id"
+# set workbranch before the name
set linentag($id) [$canv2 create text 3 $y -anchor w -fill $fgcolor \
- -text $name -font $nfont -tags text]
+ -text $workbranch -font $nfont -tags text]
set linedtag($id) [$canv3 create text 3 $y -anchor w -fill $fgcolor \
+ -text $name -font mainfont -tags text]
+ set linedtag($id) [$canv4 create text 3 $y -anchor w -fill $fgcolor \
-text $date -font mainfont -tags text]
if {$selectedline == $row} {
make_secsel $id
@@ -6993,7 +7056,7 @@ proc dispnexttag {} {
}
proc make_secsel {id} {
- global linehtag linentag linedtag canv canv2 canv3
+ global linehtag linentag linedtag canv canv2 canv3 canv4
if {![info exists linehtag($id)]} return
$canv delete secsel
@@ -7008,6 +7071,10 @@ proc make_secsel {id} {
set t [eval $canv3 create rect [$canv3 bbox $linedtag($id)] -outline {{}} \
-tags secsel -fill [$canv3 cget -selectbackground]]
$canv3 lower $t
+ $canv4 delete secsel
+ set t [eval $canv4 create rect [$canv4 bbox $linedtag($id)] -outline {{}} \
+ -tags secsel -fill [$canv4 cget -selectbackground]]
+ $canv4 lower $t
}
proc make_idmark {id} {
--
1.7.11.msysgit.1
^ permalink raw reply related
* Re: [PATCH 2/8] Add --unannotate
From: Junio C Hamano @ 2013-01-22 16:04 UTC (permalink / raw)
To: greened; +Cc: James Nylen, git
In-Reply-To: <878v7lfvz7.fsf@waller.obbligato.org>
greened@obbligato.org writes:
> Junio, is there a policy for backward-compatability in contrib? I hope
> that since that directory is for stuff not yet in mainline, there is
> some room to massage the user interface.
I do not think there is anything more than "we wish there were fewer
such end-user facing changes."
The purpose of having anything in contrib/ is to give them a way to
gain more visibility than they otherwise would as standalone
projects on their own. I don't want to control the day-to-day
quality issues in them. That is what we have "guilty parties" for
contrib/ subdirectories for, so that they can decide how mature
their pieces in contrib/ are and what kind of b/c break is
acceptable ;-)
Thanks.
^ permalink raw reply
* Re: [RFC] Instruct git-completion.bash that we are in test mode
From: Junio C Hamano @ 2013-01-22 16:31 UTC (permalink / raw)
To: Jean-Noël Avila; +Cc: Jeff King, Jean-Noël AVILA, git
In-Reply-To: <50FE47F4.20104@gmail.com>
Jean-Noël Avila <avila.jn@gmail.com> writes:
> Le 22/01/2013 05:31, Junio C Hamano a écrit :
>> Jeff King <peff@peff.net> writes:
>>
>>> I really hate to suggest this, but should it be more like:
>>>
>>> if test -z "$FAKE_COMMAND_LIST"; then __git_cmdlist() { git help -a
>>> | egrep '^ [a-zA-Z0-9]' } else __git_cmdlist() { printf '%s'
>>> "$FAKE_COMMAND_LIST" } fi
>>>
>>> That gives us a nice predictable starting point for actually
>>> testing the completion code. The downside is that it doesn't let
>>> us test that we remain compatible with the output of "help -a".
> ...
> Instead of imposing the list of command, we could use the command
> list argument to filter the ouput of git help -a. This would ensure that the
> completions we want to test are still present in the installation while
> still restricting them to the test case.
In order to "filter the output", you still need to know how output
from "git help -a" looks like, and adjust the code to filter when
the shape of the output changes. The effort to do so is pretty
similar to the amount of effort needed to maintain FAKE_COMMAND_LIST
to look like the output from "git help -a". It is of dubious value
compared to the simplicity of "printf" FAKE_COMMAND_LIST approach, I
think.
^ permalink raw reply
* Re: Aw: Re: [PATCH v3 1/6] Change old system name 'GIT' to 'Git'
From: Junio C Hamano @ 2013-01-22 16:45 UTC (permalink / raw)
To: Thomas Ackermann; +Cc: davvid, git
In-Reply-To: <1543684041.1817103.1358847866882.JavaMail.ngmail@webmail19.arcor-online.net>
Thomas Ackermann <th.acker@arcor.de> writes:
>> * Documentation/git-credential.txt:
>> TYPICAL USE OF GIT CREDENTIAL
>>
> This is to be debated because here all caps is used as "poor man's bold face"
> and it would look odd if we write 'TYPICAL USE OF Git CREDENTIAL'?
I left this as-is in my "fixup" commit, as the html and manpage
backends seem to typeset the section titles differently. I however
have to wonder what the result will look like if we replaced it with
Typical use of Git credential
Can you try and see how well it works?
> Perhaps it would be best to separate this into 2 series:
> [1/6]+[6/6] and [2/6]-[5/6]?
I'd really hate to see these patches posted again to the list and
asking for re-reviewing the whole thing. Can we go incremental
while parking these original patches on 'pu', and later squash the
whole thing into two commits, or something?
Right now I have these on 'pu':
b15ac19 Add rule for when to use 'git' and when to use 'Git'
57d4b2c Change 'git' to 'Git' whenever the whole system is referred to #4
01758e6 Change 'git' to 'Git' whenever the whole system is referred to #3
59b26cb Change 'git' to 'Git' whenever the whole system is referred to #2
e458530 Change 'git' to 'Git' whenever the whole system is referred to #1
c8fc93a Documentation: update two leftover small caps
170a796 Documentation: avoid poor-man's small caps
I will locally squash the top one (your #6) into the bottom one
(your #1). Perhaps people can proofread the result of "Some
instances of 'git' should be 'Git' as they talk about the system"
patches, and send in incremental corrections to be applied on top.
^ permalink raw reply
* Re: branch name in remote.<remote>.push is not updated after "git branch -m"
From: Junio C Hamano @ 2013-01-22 16:59 UTC (permalink / raw)
To: Andrey Borzenkov; +Cc: git
In-Reply-To: <20130122164306.3dc8b757@opensuse.site>
Andrey Borzenkov <arvidjaar@gmail.com> writes:
> I renamed branches and noticed that branch name was not changed in
> remote push config. I.e. after
>
> bor@opensuse:~/src/bootinfoscript> git branch -m github master
>
> I still have
>
> [remote "github"]
> push = github:master
> url = git://github.com/arvidjaar/bootinfoscript.git
> pushurl = git@github.com:arvidjaar/bootinfoscript.git
> fetch = +refs/heads/*:refs/remotes/github/*
>
> Is it expected behavior or possibly already fixed?
Isn't that line added manually by you?
If the line were written in a canonical and an explicit way
(i.e. "push = refs/heads/github:refs/heads/master"), it might be
nicer if "git branch -m" noticed it and adjusted the LHS of the
refspec, but even that is dubious.
The move of the old github to master by the user may well have been
because the user realized that he added something that is not ready
to be pushed out to the branch, and the next move by the end user
could be to create a github branch anew that points at an earlier
part of the history that is ready to be pushed, while keeping the
invariant "my local github branch is what I will publish".
So, in short, it is expected, and no, I do not think changing it to
"push = master:master" is necessarily an improvement.
^ permalink raw reply
* Re: [PATCH v3] Enable minimal stat checking
From: Torsten Bögershausen @ 2013-01-22 17:19 UTC (permalink / raw)
To: Robin Rosenberg
Cc: git, Junio C Hamano, j sixt, Shawn Pearce,
Torsten Bögershausen
In-Reply-To: <1358840962-12316-1-git-send-email-robin.rosenberg@dewire.com>
+core.checkstat::
+ Determines which stat fields to match between the index
+ and work tree. The user can set this to 'default' or
+ 'minimal'. Default (or explicitly 'default'), is to check
+ all fields, including the sub-second part of mtime and ctime.
+
Setting 'minimal' implies core.trustctime = false
[snip]
> - if (trust_ctime && ce->ce_ctime.sec != (unsigned int)st->st_ctime)
> - changed |= CTIME_CHANGED;
> + if (trust_ctime ? check_stat : trust_ctime/*false*/)
> + if (ce->ce_ctime.sec != (unsigned int)st->st_ctime)
> + changed |= CTIME_CHANGED;
Could that be written as:
+ if (trust_ctime && check_stat && (ce->ce_ctime.sec != (unsigned int)st->st_ctime))
+ changed |= CTIME_CHANGED;
>
> #ifdef USE_NSEC
> - if (ce->ce_mtime.nsec != ST_MTIME_NSEC(*st))
> + if (check_stat && ce->ce_mtime.nsec != ST_MTIME_NSEC(*st))
> changed |= MTIME_CHANGED;
> - if (trust_ctime && ce->ce_ctime.nsec != ST_CTIME_NSEC(*st))
> - changed |= CTIME_CHANGED;
> + if (trust_ctime ? check_stat : trust_ctime/*false*/)
> + if (ce->ce_ctime.nsec != ST_CTIME_NSEC(*st))
> + changed |= CTIME_CHANGED;
And here:
+ if (trust_ctime && check_stat && (ce->ce_ctime.nsec != ST_CTIME_NSEC(*st))
+ changed |= CTIME_CHANGED;
^ permalink raw reply
* Re: [PATCH v3] Enable minimal stat checking
From: Junio C Hamano @ 2013-01-22 17:21 UTC (permalink / raw)
To: Robin Rosenberg; +Cc: git, j sixt, Shawn Pearce
In-Reply-To: <1358840962-12316-1-git-send-email-robin.rosenberg@dewire.com>
Robin Rosenberg <robin.rosenberg@dewire.com> writes:
> Specifically the fields uid, gid, ctime, ino and dev are set to zero
> by JGit. Other implementations, eg. Git in cygwin are allegedly also
> somewhat incompatible with Git For Windows and on *nix platforms
> the resolution of the timestamps may differ.
>
> Any stat checking by git will then need to check content, which may
> be very slow, particularly on Windows. Since mtime and size
> is typically enough we should allow the user to tell git to avoid
> checking these fields if they are set to zero in the index.
>
> This change introduces a core.checkstat config option where the
> the user can select to check all fields (default), or just size
> and the whole second part of mtime (minimal).
>
> Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
The "trust_ctime ? check_stat : trust_ctime/*false*/" gave me the
same "Huh?" as it did to J6t, so I locally fixed them while
applying.
Also, even though we settled on "default/minimal", we may regret in
the future if old implementations died on an unrecognized value, as
that will forbid users from using an old Git and a new Git on the
same repository at the same time, so I'd suggest removing the "if
not default or minimal, die" and replacing it with "treat unknown
token as a do-no-harm no-op".
Interdiff would look like this.
Thanks.
config.c | 2 --
read-cache.c | 12 ++++++------
2 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/config.c b/config.c
index 2b58c75..3f638e3 100644
--- a/config.c
+++ b/config.c
@@ -571,8 +571,6 @@ static int git_default_core_config(const char *var, const char *value)
check_stat = 1;
else if (!strcasecmp(value, "minimal"))
check_stat = 0;
- else
- die_bad_config(var);
}
if (!strcmp(var, "core.quotepath")) {
diff --git a/read-cache.c b/read-cache.c
index 23db681..827ae55 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -197,16 +197,16 @@ static int ce_match_stat_basic(struct cache_entry *ce, struct stat *st)
}
if (ce->ce_mtime.sec != (unsigned int)st->st_mtime)
changed |= MTIME_CHANGED;
- if (trust_ctime ? check_stat : trust_ctime/*false*/)
- if (ce->ce_ctime.sec != (unsigned int)st->st_ctime)
- changed |= CTIME_CHANGED;
+ if (trust_ctime && check_stat &&
+ ce->ce_ctime.sec != (unsigned int)st->st_ctime)
+ changed |= CTIME_CHANGED;
#ifdef USE_NSEC
if (check_stat && ce->ce_mtime.nsec != ST_MTIME_NSEC(*st))
changed |= MTIME_CHANGED;
- if (trust_ctime ? check_stat : trust_ctime/*false*/)
- if (ce->ce_ctime.nsec != ST_CTIME_NSEC(*st))
- changed |= CTIME_CHANGED;
+ if (trust_ctime && check_stat &&
+ ce->ce_ctime.nsec != ST_CTIME_NSEC(*st))
+ changed |= CTIME_CHANGED;
#endif
if (check_stat) {
^ permalink raw reply related
* Re: Bug in latest gitk - can't click lines connecting commits
From: Junio C Hamano @ 2013-01-22 17:28 UTC (permalink / raw)
To: Paul Mackerras; +Cc: Stefan Haller, Jason Holden, git
In-Reply-To: <20130101232220.GD20724@iris.ozlabs.ibm.com>
Paul Mackerras <paulus@samba.org> writes:
> On Tue, Jan 01, 2013 at 06:54:23PM +0100, Stefan Haller wrote:
>> Jason Holden <jason.k.holden.swdev@gmail.com> wrote:
>>
>> > I was testing some patches against the latest gitk, and noticed that when I
>> > click the mouse on the lines that connect the commits in the history graph,
>> > I get an error popup with:
>> > Error: can't read "cflist_top": no such variable
>> >
>> > Looks like this was introduced in gitk commit b967135d89e8d8461d059
>> > gitk: Synchronize highlighting in file view when scrolling diff
>>
>> A patch that fixes this was proposed over two months ago, and Paul said
>> he had applied it:
>>
>> <http://permalink.gmane.org/gmane.comp.version-control.git/208162>
>>
>> However, looking at git://ozlabs.org/~paulus/gitk.git it's not there.
>> Paul?
>
> I just forgot to push it out. It's there now.
I notice that I have a handful of commits that I haven't pulled from
your repository, and the last commit on your 'master' is about 20
days old. Is it safe for me to pull these now?
I can teach myself that your push is your pull-request, but I do not
think we agreed to arrange it that way yet, so...
^ permalink raw reply
* Aw: Re: Aw: Re: [PATCH v3 1/6] Change old system name 'GIT' to 'Git'
From: Thomas Ackermann @ 2013-01-22 18:27 UTC (permalink / raw)
To: gitster, th.acker; +Cc: davvid, git
>
> I left this as-is in my "fixup" commit, as the html and manpage
> backends seem to typeset the section titles differently. I however
> have to wonder what the result will look like if we replaced it with
>
> Typical use of Git credential
>
> Can you try and see how well it works?
>
The html and manpage backends both don't change the 'poor-man's bold face'
of the section titles and all the rest of the documentation uses this same style.
So we should leave this as is.
>
> I'd really hate to see these patches posted again to the list and
> asking for re-reviewing the whole thing. Can we go incremental
> while parking these original patches on 'pu', and later squash the
> whole thing into two commits, or something?
>
Of course.
---
Thomas
^ permalink raw reply
* [PATCH] Makefile: Replace merge-file.h with merge-blobs.h in LIB_H
From: Ramsay Jones @ 2013-01-22 16:47 UTC (permalink / raw)
To: Junio C Hamano; +Cc: GIT Mailing-list
Commit fa2364ec ("Which merge_file() function do you mean?", 06-12-2012)
renamed the files merge-file.[ch] to merge-blobs.[ch], but forgot to
rename the header file in the definition of the LIB_H macro.
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 1b30d7b..a786d4c 100644
--- a/Makefile
+++ b/Makefile
@@ -649,7 +649,7 @@ LIB_H += list-objects.h
LIB_H += ll-merge.h
LIB_H += log-tree.h
LIB_H += mailmap.h
-LIB_H += merge-file.h
+LIB_H += merge-blobs.h
LIB_H += merge-recursive.h
LIB_H += mergesort.h
LIB_H += notes-cache.h
--
1.8.1
^ permalink raw reply related
* Re: Version 1.8.1 does not compile on Cygwin 1.7.14
From: Ramsay Jones @ 2013-01-22 18:31 UTC (permalink / raw)
To: Jonathan Nieder
Cc: Mark Levedahl, Alex Riesen, Junio C Hamano, Jason Pyeron, git,
Torsten Bögershausen, Stephen & Linda Smith, Eric Blake
In-Reply-To: <20130120101007.GD16339@elie.Belkin>
Jonathan Nieder wrote:
> Ramsay Jones wrote:
>
>> --- a/git-compat-util.h
>> +++ b/git-compat-util.h
>> @@ -85,12 +85,6 @@
>> #define _NETBSD_SOURCE 1
>> #define _SGI_SOURCE 1
>>
>> -#ifdef WIN32 /* Both MinGW and MSVC */
>> -#define WIN32_LEAN_AND_MEAN /* stops windows.h including winsock.h */
>> -#include <winsock2.h>
>> -#include <windows.h>
>> -#endif
>
> So, do I understand correctly that the above conditional should be
> something like
>
> #if defined(WIN32) && !defined(__CYGWIN__)
>
> to allow dropping the CYGWIN_V15_WIN32API setting?
Yes, replacing the git-compat-util.h hunk above with:
diff --git a/git-compat-util.h b/git-compat-util.h
index e5a4b74..a38ae8d 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -85,7 +85,7 @@
#define _NETBSD_SOURCE 1
#define _SGI_SOURCE 1
-#ifdef WIN32 /* Both MinGW and MSVC */
+#if defined(WIN32) && !defined(__CYGWIN__) /* Both MinGW and MSVC */
#define WIN32_LEAN_AND_MEAN /* stops windows.h including winsock.h */
#include <winsock2.h>
#include <windows.h>
will also compile on cygwin 1.5.x
> "defined(WIN32)" is used throughout git to mean "win32 and not
> cygwin", so if I understand correctly we would either need to do
Hmm ... I remember being *very* nervous of commit 435bdf8c ("Make
usage of windows.h lean and mean", 16-09-2009) exactly because it
makes the code (on cygwin) much more fragile with respect to header
include order. ;-)
As I have mentioned here before, the claim that "WIN32 is not defined
on cygwin" is simply nonsense - it depends on if/when certain header
files are included. For example, *as soon as* you include <windows.h>
(and, I suspect, many other win32 headers) then "defined(WIN32)"
is true.
Note that commit 380a4d92 ("Update cygwin.c for new mingw-64 win32 api
headers", 11-11-2012) swaps the include order for the win32.h and
git-compat-util.h header files. [I don't know the details, Mark didn't
elaborate, but it is clearly an include order problem on cygwin 1.7.x :-D ]
This causes compilation errors on cygwin 1.5.x, exactly because win32.h
includes <windows.h>, which defines WIN32, which then leads to
git-compat-util.h including <winsock2.h>.
> #if defined(WIN32) && defined(__CYGWIN__)
> # undef WIN32
> #endif
Hmm, except when you want it defined on cygwin, of course ... ;-)
> Thanks for investigating.
No problem.
I've included the updated patch below, just for completeness.
HTH
ATB,
Ramsay Jones
-- >8 --
Subject: [PATCH] cygwin: Remove the CYGWIN_V15_WIN32API config
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
---
Makefile | 7 -------
compat/cygwin.c | 5 -----
config.mak.uname | 1 -
git-compat-util.h | 2 +-
4 files changed, 1 insertion(+), 14 deletions(-)
diff --git a/Makefile b/Makefile
index 1b30d7b..1c84f68 100644
--- a/Makefile
+++ b/Makefile
@@ -281,10 +281,6 @@ all::
#
# Define NO_REGEX if you have no or inferior regex support in your C library.
#
-# Define CYGWIN_V15_WIN32API if you are using Cygwin v1.7.x but are not
-# using the current w32api packages. The recommended approach, however,
-# is to update your installation if compilation errors occur.
-#
# Define HAVE_DEV_TTY if your system can open /dev/tty to interact with the
# user.
#
@@ -1402,9 +1398,6 @@ ifdef NO_REGEX
COMPAT_CFLAGS += -Icompat/regex
COMPAT_OBJS += compat/regex/regex.o
endif
-ifdef CYGWIN_V15_WIN32API
- COMPAT_CFLAGS += -DCYGWIN_V15_WIN32API
-endif
ifdef USE_NED_ALLOCATOR
COMPAT_CFLAGS += -Icompat/nedmalloc
diff --git a/compat/cygwin.c b/compat/cygwin.c
index 5428858..0a9aa6d 100644
--- a/compat/cygwin.c
+++ b/compat/cygwin.c
@@ -1,13 +1,8 @@
#define WIN32_LEAN_AND_MEAN
-#ifdef CYGWIN_V15_WIN32API
-#include "../git-compat-util.h"
-#include "win32.h"
-#else
#include <sys/stat.h>
#include <sys/errno.h>
#include "win32.h"
#include "../git-compat-util.h"
-#endif
#include "../cache.h" /* to read configuration */
static inline void filetime_to_timespec(const FILETIME *ft, struct timespec *ts)
diff --git a/config.mak.uname b/config.mak.uname
index bea34f0..5e493c9 100644
--- a/config.mak.uname
+++ b/config.mak.uname
@@ -158,7 +158,6 @@ ifeq ($(uname_O),Cygwin)
NO_SYMLINK_HEAD = YesPlease
NO_IPV6 = YesPlease
OLD_ICONV = UnfortunatelyYes
- CYGWIN_V15_WIN32API = YesPlease
endif
NO_THREAD_SAFE_PREAD = YesPlease
NEEDS_LIBICONV = YesPlease
diff --git a/git-compat-util.h b/git-compat-util.h
index e5a4b74..a38ae8d 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -85,7 +85,7 @@
#define _NETBSD_SOURCE 1
#define _SGI_SOURCE 1
-#ifdef WIN32 /* Both MinGW and MSVC */
+#if defined(WIN32) && !defined(__CYGWIN__) /* Both MinGW and MSVC */
#define WIN32_LEAN_AND_MEAN /* stops windows.h including winsock.h */
#include <winsock2.h>
#include <windows.h>
--
1.8.1
^ permalink raw reply related
* Re: [msysGit] Re: Version 1.8.1 does not compile on Cygwin 1.7.14
From: Ramsay Jones @ 2013-01-22 18:38 UTC (permalink / raw)
To: Torsten Bögershausen
Cc: Jonathan Nieder, Mark Levedahl, Alex Riesen, Junio C Hamano,
Jason Pyeron, git, Stephen & Linda Smith, Eric Blake, msysGit
In-Reply-To: <50FCD017.6060607@web.de>
Torsten Bögershausen wrote:
> On 20.01.13 12:06, Jonathan Nieder wrote:
>> Torsten Bögershausen wrote:
>>
>>> I wonder, if if we can go one step further:
>>>
>>> Replace
>>> #ifdef WIN32 /* Both MinGW and MSVC */
>> [...]
>>> with
>>> #if defined(_MSC_VER)
>>
>> I thought Git for Windows was built using mingw, which doesn't define
>> _MSC_VER?
>>
>> Puzzled,
>> Jonathan
>>
> Yes,
> After removing these lines in the git-compat-util.h of msysgit
> v1.8.1 it still compiled.
> So I start to speculate if the comment is still valid for mingw,
> or if that was true in the old days and not now any more.
>
> More investigation is needed, sorry for confusion.
Yes, I compiled the last patch on MinGW before I sent it to the list.
I didn't bother with MSVC, since that build is already broken.
I have a patch which fixed the MSVC build, but it already needs to
be updated, since current master fails to build on MSVC.
ATB,
Ramsay Jones
^ permalink raw reply
* Re: [PATCH] Makefile: Replace merge-file.h with merge-blobs.h in LIB_H
From: Junio C Hamano @ 2013-01-22 18:48 UTC (permalink / raw)
To: Ramsay Jones; +Cc: Git Mailing-list
In-Reply-To: <50FEC2B3.3010000@ramsay1.demon.co.uk>
Thanks.
^ permalink raw reply
* Re: Build broken for contrib/remote-helpers...
From: Jeff King @ 2013-01-22 19:41 UTC (permalink / raw)
To: John Szakmeister; +Cc: Felipe Contreras, git
In-Reply-To: <CAEBDL5U+Yrny-YgN1fZj1T+XTJRVaiFvMixT13Zzb2DhhYgQsA@mail.gmail.com>
On Tue, Jan 22, 2013 at 12:49:31AM -0500, John Szakmeister wrote:
> I tried running make in contrib/remote-helpers and it died with:
>
> :: make
> make -e -C ../../t test
> rm -f -r test-results
> duplicate test numbers: /Users/jszakmeister/sources/git
> make[1]: *** [test-lint-duplicates] Error 1
> make: *** [test] Error 2
>
> The path shown is not quite correct. I have the sources extracted to
> /Users/jszakmeister/sources/git-1.8.1.1. It appears that the Makefile
> in contrib/remote-helpers is exporting T, which is causing the
> duplicate test detection to fail.
It has to set T, because that is how t/Makefile knows what the set of
tests is. The problem is that test-lint-duplicates does not understand
absolute pathnames, as its regex is too simplistic:
sed 's/-.*//' | sort | uniq -d
So it finds whatever is before the first "-", which would be the test
number in "t0000-basic.sh" or similar, and then looks for duplicates.
We can make the regex more strict to handle full paths, like:
perl -lne 'print $1 if m{(?:^|/)(t\d{4})-}'
but that still would not help, as the tests in remote-helpers do not
follow the tXXXX convention. So I think even running
test-lint-duplicates on them is nonsensical.
Maybe something like this would be more appropriate, though it kills off
all test-lint checks, not just test-lint-duplicates:
diff --git a/contrib/remote-helpers/Makefile b/contrib/remote-helpers/Makefile
index 9a76575..9c18ed8 100644
--- a/contrib/remote-helpers/Makefile
+++ b/contrib/remote-helpers/Makefile
@@ -3,6 +3,7 @@ export PATH := $(CURDIR):$(PATH)
export T := $(addprefix $(CURDIR)/,$(TESTS))
export MAKE := $(MAKE) -e
export PATH := $(CURDIR):$(PATH)
+export TEST_LINT :=
test:
$(MAKE) -C ../../t $@
^ permalink raw reply related
* Re: [PATCH v2] unpack-trees: do not abort when overwriting an existing file with the same content
From: Jeff King @ 2013-01-22 20:19 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Duy Nguyen, git
In-Reply-To: <7vwqv6c7oe.fsf@alter.siamese.dyndns.org>
On Mon, Jan 21, 2013 at 05:45:05PM -0800, Junio C Hamano wrote:
> Duy Nguyen <pclouds@gmail.com> writes:
>
> > On Tue, Jan 22, 2013 at 6:15 AM, Jeff King <peff@peff.net> wrote:
> >> Can you elaborate on when this code is triggered?
> >>
> >> In the general case, shouldn't we already know the sha1 of what's on
> >> disk in the index, and be able to just compare the hashes? And if we
> >> don't, because the entry is start-dirty, should we be updating it
> >> (possibly earlier, so we do not even get into the "need to write" code
> >> path) instead of doing this ad-hoc byte comparison?
>
> If the index knows what is in the working tree, I think I agree.
Right. I was wondering why it didn't (and if it doesn't, why we are not
saving the information there).
But I think I was letting my inaccurate mental model of the index get in
the way. I tend to think of the stat information as "if the file matches
this stat info, then it has sha1 X". But that is not true. The sha1 we
store is the actual index entry, and if it does not match what is in the
working tree, we do not know or store the sha1 of what is in the working
tree. We cannot just "refresh" that value and compare it, which is what
I was implying.
So I think I was just confused. That is what I get for not actually
doing low-level index stuff enough.
> > git reset HEAD~10
> > # blah that was a mistake, undo it
> > git checkout HEAD@{1}
It seems like
git reset HEAD@{1}
would be the correct undo, as the original never touched the working
tree.
-Peff
^ permalink raw reply
* Re: [PATCH v3] Enable minimal stat checking
From: Robin Rosenberg @ 2013-01-22 20:38 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, j sixt, Shawn Pearce
In-Reply-To: <7va9s19lrb.fsf@alter.siamese.dyndns.org>
----- Ursprungligt meddelande -----
> Also, even though we settled on "default/minimal", we may regret in
> the future if old implementations died on an unrecognized value, as
> that will forbid users from using an old Git and a new Git on the
> same repository at the same time, so I'd suggest removing the "if
> not default or minimal, die" and replacing it with "treat unknown
> token as a do-no-harm no-op".
I decided on error after looking at how other configuration errors
are handled, but I can change, though I personally prefer to get
configuration mistakes thrown in my face so I know.
-- robin
^ permalink raw reply
* Re: Build broken for contrib/remote-helpers...
From: Torsten Bögershausen @ 2013-01-22 20:55 UTC (permalink / raw)
To: Jeff King; +Cc: John Szakmeister, Felipe Contreras, git
In-Reply-To: <20130122194135.GA23521@sigill.intra.peff.net>
On 22.01.13 20:41, Jeff King wrote:
> On Tue, Jan 22, 2013 at 12:49:31AM -0500, John Szakmeister wrote:
>
>> I tried running make in contrib/remote-helpers and it died with:
>>
>> :: make
>> make -e -C ../../t test
>> rm -f -r test-results
>> duplicate test numbers: /Users/jszakmeister/sources/git
>> make[1]: *** [test-lint-duplicates] Error 1
>> make: *** [test] Error 2
>>
>> The path shown is not quite correct. I have the sources extracted to
>> /Users/jszakmeister/sources/git-1.8.1.1. It appears that the Makefile
>> in contrib/remote-helpers is exporting T, which is causing the
>> duplicate test detection to fail.
>
> It has to set T, because that is how t/Makefile knows what the set of
> tests is. The problem is that test-lint-duplicates does not understand
> absolute pathnames, as its regex is too simplistic:
>
> sed 's/-.*//' | sort | uniq -d
>
> So it finds whatever is before the first "-", which would be the test
> number in "t0000-basic.sh" or similar, and then looks for duplicates.
would it help to filter for numbered tests before sorting like this:
sed 's/-.*//' | grep "[0-9][0-9][0-9][0-9]"| sort | uniq -d
^ permalink raw reply
* [PATCH] all: new command used for multi-repo operations
From: Lars Hjemli @ 2013-01-22 21:10 UTC (permalink / raw)
To: git; +Cc: Lars Hjemli
When working with multiple, unrelated (or loosly related) git repos,
there is often a need to locate all repos with uncommitted work and
perform some action on them (say, commit and push). Before this patch,
such tasks would require manually visiting all repositories, running
`git status` within each one and then decide what to do next.
This mundane task can now be automated by e.g. `git all --dirty status`,
which will find all git repositories below the current directory (even
nested ones), check if they are dirty (as defined by `git diff --quiet &&
git diff --cached --quiet`), and for each dirty repo print the path to the
repo and then execute `git status` within the repo.
The command also honours the option '--clean' which restricts the set of
repos to those which '--dirty' would skip.
Finally, the command to execute within each repo is optional. If none is
given, git-all will just print the path to each repo found.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
---
Documentation/git-all.txt | 37 ++++++++++++++++
Makefile | 1 +
builtin.h | 1 +
builtin/all.c | 105 ++++++++++++++++++++++++++++++++++++++++++++++
command-list.txt | 1 +
git.c | 1 +
t/t0064-all.sh | 42 +++++++++++++++++++
7 files changed, 188 insertions(+)
create mode 100644 Documentation/git-all.txt
create mode 100644 builtin/all.c
create mode 100755 t/t0064-all.sh
diff --git a/Documentation/git-all.txt b/Documentation/git-all.txt
new file mode 100644
index 0000000..b25f23c
--- /dev/null
+++ b/Documentation/git-all.txt
@@ -0,0 +1,37 @@
+git-all(1)
+==========
+
+NAME
+----
+git-all - Execute a git command in multiple repositories
+
+SYNOPSIS
+--------
+[verse]
+'git all' [--dirty|--clean] [command]
+
+DESCRIPTION
+-----------
+The git-all command is used to locate all git repositoris within the
+current directory tree, and optionally execute a git command in each
+of the found repos.
+
+OPTIONS
+-------
+-c::
+--clean::
+ Only include repositories with a clean worktree.
+
+-d::
+--dirty::
+ Only include repositories with a dirty worktree.
+
+NOTES
+-----
+
+For the purpose of `git-all`, a dirty worktree is defined as a worktree
+with uncommitted changes.
+
+GIT
+---
+Part of the linkgit:git[1] suite
diff --git a/Makefile b/Makefile
index 1b30d7b..8bf0583 100644
--- a/Makefile
+++ b/Makefile
@@ -840,6 +840,7 @@ LIB_OBJS += xdiff-interface.o
LIB_OBJS += zlib.o
BUILTIN_OBJS += builtin/add.o
+BUILTIN_OBJS += builtin/all.o
BUILTIN_OBJS += builtin/annotate.o
BUILTIN_OBJS += builtin/apply.o
BUILTIN_OBJS += builtin/archive.o
diff --git a/builtin.h b/builtin.h
index 7e7bbd6..438c265 100644
--- a/builtin.h
+++ b/builtin.h
@@ -41,6 +41,7 @@ void finish_copy_notes_for_rewrite(struct notes_rewrite_cfg *c);
extern int textconv_object(const char *path, unsigned mode, const unsigned char *sha1, int sha1_valid, char **buf, unsigned long *buf_size);
extern int cmd_add(int argc, const char **argv, const char *prefix);
+extern int cmd_all(int argc, const char **argv, const char *prefix);
extern int cmd_annotate(int argc, const char **argv, const char *prefix);
extern int cmd_apply(int argc, const char **argv, const char *prefix);
extern int cmd_archive(int argc, const char **argv, const char *prefix);
diff --git a/builtin/all.c b/builtin/all.c
new file mode 100644
index 0000000..ee9270d
--- /dev/null
+++ b/builtin/all.c
@@ -0,0 +1,105 @@
+/*
+ * "git all" builtin command.
+ *
+ * Copyright (c) 2013 Lars Hjemli <hjemli@gmail.com>
+ */
+#include "cache.h"
+#include "color.h"
+#include "builtin.h"
+#include "run-command.h"
+#include "parse-options.h"
+
+static int only_dirty;
+static int only_clean;
+char root[PATH_MAX];
+
+static const char * const builtin_all_usage[] = {
+ N_("git all [options] [cmd]"),
+ NULL
+};
+
+static struct option builtin_all_options[] = {
+ OPT_BOOLEAN('c', "clean", &only_clean, N_("only show clean repositories")),
+ OPT_BOOLEAN('d', "dirty", &only_dirty, N_("only show dirty repositories")),
+ OPT_END(),
+};
+
+static int is_dirty()
+{
+ const char *diffidx[] = {"diff", "--quiet", "--cached", NULL};
+ const char *diffwd[] = {"diff", "--quiet", NULL};
+
+ if (run_command_v_opt(diffidx, RUN_GIT_CMD) != 0)
+ return 1;
+ if (run_command_v_opt(diffwd, RUN_GIT_CMD) != 0)
+ return 1;
+ return 0;
+}
+
+static void handle_repo(char *path, const char **argv)
+{
+ int dirty;
+
+ if (path[0] == '.' && path[1] == '/')
+ path += 2;
+ if (only_dirty || only_clean) {
+ dirty = is_dirty();
+ if ((dirty && only_clean) ||
+ (!dirty && only_dirty))
+ return;
+ }
+ if (*argv) {
+ color_fprintf_ln(stdout, GIT_COLOR_YELLOW, "[%s]", path);
+ run_command_v_opt(argv, RUN_GIT_CMD);
+ } else
+ printf("%s\n", path);
+}
+
+static int walk(struct strbuf *path, int argc, const char **argv)
+{
+ DIR *dir;
+ struct dirent *ent;
+ size_t len;
+
+ dir = opendir(path->buf);
+ if (!dir)
+ return errno;
+ strbuf_addstr(path, "/");
+ len = path->len;
+ while ((ent = readdir(dir))) {
+ if (!strcmp(ent->d_name, ".") || !strcmp(ent->d_name, ".."))
+ continue;
+ if (!strcmp(ent->d_name, ".git")) {
+ strbuf_setlen(path, len - 1);
+ chdir(path->buf);
+ handle_repo(path->buf, argv);
+ chdir(root);
+ strbuf_addstr(path, "/");
+ continue;
+ }
+ if (ent->d_type != DT_DIR)
+ continue;
+ strbuf_setlen(path, len);
+ strbuf_addstr(path, ent->d_name);
+ walk(path, argc, argv);
+ }
+ closedir(dir);
+ return 0;
+}
+
+int cmd_all(int argc, const char **argv, const char *prefix)
+{
+ struct strbuf path = STRBUF_INIT;
+
+ if (!getcwd(root, sizeof(root)))
+ return 1;
+
+ argc = parse_options(argc, argv, prefix, builtin_all_options,
+ builtin_all_usage, PARSE_OPT_STOP_AT_NON_OPTION);
+
+ unsetenv(GIT_DIR_ENVIRONMENT);
+ unsetenv(GIT_WORK_TREE_ENVIRONMENT);
+
+ strbuf_addstr(&path, ".");
+ return walk(&path, argc, argv);
+}
diff --git a/command-list.txt b/command-list.txt
index 7e8cfec..f955895 100644
--- a/command-list.txt
+++ b/command-list.txt
@@ -1,6 +1,7 @@
# List of known git commands.
# command name category [deprecated] [common]
git-add mainporcelain common
+git-all mainporcelain
git-am mainporcelain
git-annotate ancillaryinterrogators
git-apply plumbingmanipulators
diff --git a/git.c b/git.c
index ed66c66..53fd963 100644
--- a/git.c
+++ b/git.c
@@ -304,6 +304,7 @@ static void handle_internal_command(int argc, const char **argv)
const char *cmd = argv[0];
static struct cmd_struct commands[] = {
{ "add", cmd_add, RUN_SETUP | NEED_WORK_TREE },
+ { "all", cmd_all },
{ "annotate", cmd_annotate, RUN_SETUP },
{ "apply", cmd_apply, RUN_SETUP_GENTLY },
{ "archive", cmd_archive },
diff --git a/t/t0064-all.sh b/t/t0064-all.sh
new file mode 100755
index 0000000..932e374
--- /dev/null
+++ b/t/t0064-all.sh
@@ -0,0 +1,42 @@
+#!/bin/sh
+#
+# Copyright (c) 2013 Lars Hjemli
+#
+
+test_description='Test the git-all command'
+
+. ./test-lib.sh
+
+test_expect_success "setup" '
+ test_create_repo clean &&
+ (cd clean && test_commit foo) &&
+ test_create_repo dirty-wt &&
+ (cd dirty-wt && test_commit foo && rm foo.t) &&
+ test_create_repo dirty-idx &&
+ (cd dirty-idx && test_commit foo && git rm foo.t)
+'
+
+test_expect_success "without flags, all repos are included" '
+ echo "." >expect &&
+ echo "clean" >>expect &&
+ echo "dirty-idx" >>expect &&
+ echo "dirty-wt" >>expect &&
+ git all | sort >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success "--dirty only includes dirty repos" '
+ echo "dirty-idx" >expect &&
+ echo "dirty-wt" >>expect &&
+ git all --dirty | sort >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success "--clean only includes clean repos" '
+ echo "." >expect &&
+ echo "clean" >>expect &&
+ git all --clean | sort >actual &&
+ test_cmp expect actual
+'
+
+test_done
--
1.8.1.1.296.g725455c
^ permalink raw reply related
* Re: GIT get corrupted on lustre
From: Eric Chamberland @ 2013-01-22 21:31 UTC (permalink / raw)
To: Thomas Rast
Cc: Brian J. Murrell, git, kusmabite, Pyeron, Jason J CTR (US),
Maxime Boissonneault, Philippe Vaucher, Sébastien Boisvert
In-Reply-To: <87r4lejpx8.fsf@pctrast.inf.ethz.ch>
So, hum, do we have some sort of conclusion?
Shall it be a fix for git to get around that lustre "behavior"?
If something can be done in git it would be great: it is a *lot* easier
to change git than the lustre filesystem software for a cluster in
running in production mode... (words from cluster team) :-/
I hope this subject will not die in the list... :-/
Thanks,
Eric
On 01/21/2013 02:29 PM, Thomas Rast wrote:
> Please don't drop the Cc list!
>
> "Brian J. Murrell" <brian@interlinx.bc.ca> writes:
>
>>> What's odd is that while I cannot reproduce the original problem, there
>>> seems to be another issue/bug with utime():
>>
>> I wonder if this is related to http://jira.whamcloud.com/browse/LU-305.
>> That was reported as fixed in Lustre 2.0.0 and 2.1.0 but I thought I
>> saw it on 2.1.1 and added a comment to the above ticket about that.
>
> Aha, that's a very interesting bug report. My observations support
> yours: I managed to get EINTR during utime().
>
>>> In the absence of it, wouldn't we in theory have to write a simple
>>> loop-on-EINTR wrapper for *all* syscalls?
>>
>> IIUC, that's what SA_RESTART is all about.
>
> Yes, but there's precious little clear language on when SA_RESTART is
> supposed to act. In all cases?
>
> The wording on
>
> http://www.delorie.com/gnu/docs/glibc/libc_485.html
> http://www.delorie.com/gnu/docs/glibc/libc_498.html
>
> leads me to believe that SA_RESTART is actually used on the glibc side
> of things, so that any glibc syscall wrapper not specifically equipped
> with the restarting behavior would return EINTR unmodified. This might
> explain why utime() doesn't restart like it should (assuming we work on
> the theory that POSIX doesn't allow an EINTR from utime() to begin
> with).
>
^ permalink raw reply
* Re: [PATCH v3 01/10] wildmatch: fix "**" special case
From: Junio C Hamano @ 2013-01-22 21:36 UTC (permalink / raw)
To: Nguyễn Thái Ngọc Duy; +Cc: git
In-Reply-To: <1357008251-10014-2-git-send-email-pclouds@gmail.com>
Nguyễn Thái Ngọc Duy <pclouds@gmail.com> writes:
> "**" is adjusted to only be effective when surrounded by slashes, in
> 40bbee0 (wildmatch: adjust "**" behavior - 2012-10-15). Except that
> the commit did it wrong:
>
> 1. when it checks for "the preceding slash unless ** is at the
> beginning", it compares to wrong pointer. It should have compared
> to the beginning of the pattern, not the text.
So should
git ls-files '**/Makefile'
list the Makefile at the top-level of the repository (I think it
should)?
But that does not seem to be working.
I think the callpath goes like this:
match_pathspec()
-> match_one()
-> fnmatch_icase()
-> fnmatch()
-> wildmatch()
and the problem is that the fnmatch_icase() call made by match_one()
always passes 0 as the value for flags. Without WM_PATHNAME,
however, the underlying dowild() does not honor the "**/" magic.
We obviously do not want to set FNM_PATHNAME when we are not
substituting fnmatch() with wildmatch(), but I wonder if it may make
sense to unconditionally use WM_PATHNAME semantics when we build the
system with USE_WILDMATCH and calling wildmatch() in this codepath.
Users can always use "*/**/*" in place of "*" in their patterns
where they want to ignore directory boundaries.
^ permalink raw reply
* Re: [PATCH] all: new command used for multi-repo operations
From: Junio C Hamano @ 2013-01-22 22:01 UTC (permalink / raw)
To: Lars Hjemli; +Cc: git
In-Reply-To: <1358889019-4554-1-git-send-email-hjemli@gmail.com>
Lars Hjemli <hjemli@gmail.com> writes:
> diff --git a/builtin/all.c b/builtin/all.c
> new file mode 100644
> index 0000000..ee9270d
> --- /dev/null
> +++ b/builtin/all.c
> @@ -0,0 +1,105 @@
> +/*
> + * "git all" builtin command.
> + *
> + * Copyright (c) 2013 Lars Hjemli <hjemli@gmail.com>
> + */
> +#include "cache.h"
> +#include "color.h"
> +#include "builtin.h"
> +#include "run-command.h"
> +#include "parse-options.h"
> +
> +static int only_dirty;
> +static int only_clean;
> +char root[PATH_MAX];
> +
> +static const char * const builtin_all_usage[] = {
> + N_("git all [options] [cmd]"),
> + NULL
> +};
> +
> +static struct option builtin_all_options[] = {
> + OPT_BOOLEAN('c', "clean", &only_clean, N_("only show clean repositories")),
> + OPT_BOOLEAN('d', "dirty", &only_dirty, N_("only show dirty repositories")),
> + OPT_END(),
> +};
Shouldn't this be more like OPT_SET_INT() on a same variable that is
initialized to "all"? Alternatively you could validate the input
and die when both are given.
> +int cmd_all(int argc, const char **argv, const char *prefix)
> +{
> + struct strbuf path = STRBUF_INIT;
> +
> + if (!getcwd(root, sizeof(root)))
> + return 1;
> +
> + argc = parse_options(argc, argv, prefix, builtin_all_options,
> + builtin_all_usage, PARSE_OPT_STOP_AT_NON_OPTION);
> +
> + unsetenv(GIT_DIR_ENVIRONMENT);
> + unsetenv(GIT_WORK_TREE_ENVIRONMENT);
Don't you need to clear other variables whose uses are closely tied
to a single repository, like GIT_INDEX_FILE, etc.?
I suspect that explicitly exporting GIT_DIR and GIT_WORK_TREE (and
nothing else) in handle_repo() to the location you discovered before
you run the per-repository command via run_command_v_opt(), might be
a better alternative. The user could be sharing objects in all
repositories by permanently setting GIT_OBJECT_DIRECTORY to a single
place.
> diff --git a/command-list.txt b/command-list.txt
> index 7e8cfec..f955895 100644
> --- a/command-list.txt
> +++ b/command-list.txt
> @@ -1,6 +1,7 @@
> # List of known git commands.
> # command name category [deprecated] [common]
> git-add mainporcelain common
> +git-all mainporcelain
> git-am mainporcelain
> git-annotate ancillaryinterrogators
> git-apply plumbingmanipulators
I am not very interested in this topic in the first place, but this
does not (at least not yet) sound like a main Porcelain to me.
"all" may be a word other people may want to use to call collections
of things other than "Git repositories", and that use may turn out
to be more useful in general. A name that makes it clear that this
is about "repositories", i.e. along the lines of "git for-each-repo"
or something, would be a better name that does not squat on such a
short and sweet name.
^ permalink raw reply
* Re: GIT get corrupted on lustre
From: Junio C Hamano @ 2013-01-22 22:03 UTC (permalink / raw)
To: Eric Chamberland
Cc: Thomas Rast, Brian J. Murrell, git, kusmabite,
Pyeron, Jason J CTR (US), Maxime Boissonneault, Philippe Vaucher,
Sébastien Boisvert
In-Reply-To: <50FF051D.5090804@giref.ulaval.ca>
Eric Chamberland <Eric.Chamberland@giref.ulaval.ca> writes:
> So, hum, do we have some sort of conclusion?
>
> Shall it be a fix for git to get around that lustre "behavior"?
>
> If something can be done in git it would be great: it is a *lot*
> easier to change git than the lustre filesystem software for a cluster
> in running in production mode... (words from cluster team) :-/
Do we know the real cause of the symptom? I did not follow the
thread carefully, but the impression I was getting was that the
filesystem is broken around EINTR, and even if you "fix"ed Git,
your other more mission critical applications will be broken by
the same filesystem behaviour, no?
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox