* [PATCH] Documentation: clarify diff.external limitations
From: Anders Melchiorsen @ 2008-07-27 11:12 UTC (permalink / raw)
To: git; +Cc: gitster, Anders Melchiorsen
The diff.external examples pass a flag to gnu-diff, but that is not
actually supported.
Without the flag, diff will still complain about an extra operand
because git is passing 7 parameters to the external command.
Both of these are fixed by suggesting a diff-wrapper and pointing to
the description of the parameters passed.
Signed-off-by: Anders Melchiorsen <mail@cup.kalibalik.dk>
---
Documentation/config.txt | 10 ++++++----
Documentation/git-config.txt | 2 +-
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/Documentation/config.txt b/Documentation/config.txt
index 798b551..1a13abc 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -92,7 +92,7 @@ Example
# Our diff algorithm
[diff]
- external = "/usr/local/bin/gnu-diff -u"
+ external = /usr/local/bin/diff-wrapper
renames = true
[branch "devel"]
@@ -563,9 +563,11 @@ diff.autorefreshindex::
diff.external::
If this config variable is set, diff generation is not
performed using the internal diff machinery, but using the
- given command. Note: if you want to use an external diff
- program only on a subset of your files, you might want to
- use linkgit:gitattributes[5] instead.
+ given command. Can be overridden with the `GIT_EXTERNAL_DIFF'
+ environment variable. The command is called with parameters
+ as described under "git Diffs" in linkgit:git[1]. Note: if
+ you want to use an external diff program only on a subset of
+ your files, you might want to use linkgit:gitattributes[5] instead.
diff.renameLimit::
The number of files to consider when performing the copy/rename
diff --git a/Documentation/git-config.txt b/Documentation/git-config.txt
index 697824c..28e1861 100644
--- a/Documentation/git-config.txt
+++ b/Documentation/git-config.txt
@@ -222,7 +222,7 @@ Given a .git/config like this:
; Our diff algorithm
[diff]
- external = "/usr/local/bin/gnu-diff -u"
+ external = /usr/local/bin/diff-wrapper
renames = true
; Proxy settings
--
1.5.4.3
^ permalink raw reply related
* [PATCH] Make use of stat.ctime configurable
From: Alex Riesen @ 2008-07-26 15:38 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: Linus Torvalds, Junio C Hamano, Johannes Sixt, git
In-Reply-To: <alpine.DEB.1.00.0807260256030.11976@eeepc-johanness>
because there are situations where it produces too much false
positives. Like when file system crawlers keep changing it when
scanning and using the ctime for marking scanned files.
The default is to allow use of ctime.
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
---
Johannes Schindelin, Sat, Jul 26, 2008 02:57:25 +0200:
> On Fri, 25 Jul 2008, Alex Riesen wrote:
> > But, given the fact, that somewhere sometimes its very-very annoying to
> > have even one (un)changed file, something must be done about it. Maybe
> > just direct
> >
> > [...]
> > trustctime = false
>
> ... which is all Junio and I were asking all along: a separate way to ask
> for ignoring ctime; not just DWIM it on top of the executable bit.
Oh...
cache.h | 1 +
config.c | 4 ++++
environment.c | 1 +
read-cache.c | 2 +-
4 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/cache.h b/cache.h
index 38985aa..00d02d3 100644
--- a/cache.h
+++ b/cache.h
@@ -421,6 +421,7 @@ extern int delete_ref(const char *, const unsigned char *sha1);
/* Environment bits from configuration mechanism */
extern int trust_executable_bit;
+extern int trust_file_ctime;
extern int quote_path_fully;
extern int has_symlinks;
extern int ignore_case;
diff --git a/config.c b/config.c
index 1e066c7..860e8ab 100644
--- a/config.c
+++ b/config.c
@@ -341,6 +341,10 @@ static int git_default_core_config(const char *var, const char *value)
trust_executable_bit = git_config_bool(var, value);
return 0;
}
+ if (!strcmp(var, "core.filectime")) {
+ trust_file_ctime = git_config_bool(var, value);
+ return 0;
+ }
if (!strcmp(var, "core.quotepath")) {
quote_path_fully = git_config_bool(var, value);
diff --git a/environment.c b/environment.c
index 4a88a17..4982771 100644
--- a/environment.c
+++ b/environment.c
@@ -13,6 +13,7 @@ char git_default_email[MAX_GITNAME];
char git_default_name[MAX_GITNAME];
int user_ident_explicitly_given;
int trust_executable_bit = 1;
+int trust_file_ctime = 1;
int has_symlinks = 1;
int ignore_case;
int assume_unchanged;
diff --git a/read-cache.c b/read-cache.c
index a50a851..00d39dc 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -181,7 +181,7 @@ static int ce_match_stat_basic(struct cache_entry *ce, struct stat *st)
}
if (ce->ce_mtime != (unsigned int) st->st_mtime)
changed |= MTIME_CHANGED;
- if (ce->ce_ctime != (unsigned int) st->st_ctime)
+ if (trust_file_ctime && ce->ce_ctime != (unsigned int) st->st_ctime)
changed |= CTIME_CHANGED;
if (ce->ce_uid != (unsigned int) st->st_uid ||
--
1.6.0.rc0.76.g581e
^ permalink raw reply related
* Re: [PATCH] Optional grouping of projects by category.
From: Jakub Narebski @ 2008-07-27 8:53 UTC (permalink / raw)
To: Sebastien Cevey; +Cc: git
In-Reply-To: <8763qsi2mt.wl%seb@cine7.net>
Sebastien Cevey <seb@cine7.net> writes:
> This adds the GITWEB_GROUP_CATEGORIES option which, if enabled, will
> result in grouping projects by category on the project list page. The
> category is specified for each project by the $GIT_DIR/category file
> or the 'category' variable in its configuration file.
>
> The feature is inspired from Sham Chukoury's patch for the XMMS2
> gitweb, but has been rewritten for the current gitweb development
> HEAD.
>
> Thanks to Florian Ragwitz for Perl tips.
Thanks a lot. I don't know if it is a good time, with git being in
feature freeze, and GSoC project about adding caching to gitweb in the
works, but I'll take this patch and resend it if needed. I'll try to
comment on it soon.
That said, I think that the subject (oneline commit summary) should
include 'gitweb', e.g.
"gitweb: Optional grouping of projects by category"
--
Jakub Narebski
Poland
ShadeHawk on #git
^ permalink raw reply
* Re: StGit: kha/{stable,safe,experimental} updated
From: Catalin Marinas @ 2008-07-27 8:44 UTC (permalink / raw)
To: Karl Hasselström; +Cc: git, Samuel Tardieu
In-Reply-To: <20080725013936.GA20959@diana.vm.bytemark.co.uk>
2008/7/25 Karl Hasselström <kha@treskal.com>:
> The big update since last time is support (in kha/experimental) for
> hidden patches in the new-infrastructure commands and stack log.
>
> Unless more problems are uncovered, I'll soon move all patches in
> experimental to safe (which means I'll be recommending that Catalin
> merge them).
I'll have a look at the new stack log format (my main worry) this week
but the other patches look OK.
I merged the safe and stable branches.
Thanks.
--
Catalin
^ permalink raw reply
* Re: [StGit PATCH] Fix some remaining old-style stg id calls
From: Catalin Marinas @ 2008-07-27 8:24 UTC (permalink / raw)
To: Karl Hasselström; +Cc: git
In-Reply-To: <20080725004430.12440.49829.stgit@yoghurt>
2008/7/25 Karl Hasselström <kha@treskal.com>:
> You'll want to add this (just squash it into your patch). The calls
> were failing, but since both sides produced the empty string on
> stdout, the test was happy anyway.
Thanks, that's why I haven't noticed it.
--
Catalin
^ permalink raw reply
* Re: [StGit PATCH] Fixed default install location
From: Catalin Marinas @ 2008-07-27 8:21 UTC (permalink / raw)
To: Daniel White; +Cc: git
In-Reply-To: <20080727162750.25b7cdf3@whitehouse.id.au>
2008/7/27 Daniel White <daniel@whitehouse.id.au>:
> "Catalin Marinas" <catalin.marinas@gmail.com> wrote:
>>
>> I also use "python setup.py bdist_rpm" when releasing, I think it will
>> get confused by a different prefix.
>
> Not being familiar with distutils, I didn't even see that use case.
I use "python setup.py bdist_rpm", though passing --prefix would
probably fix it.
> Regardless, the instructions are incorrect and the behaviour surprising.
> When I installed this in a cygwin environment, it went on to clobber
> my system directories.
>
> Would it be more useful to have the Makefile handle the general case and
> setup.py for more specialised cases, such as generating an rpm?
I agree.
> I've thrown some patches together that does some of this. I can tidy
> these up and put them in a public repository if this sounds like a
> reasonable plan of attack.
Yes, it is. Please base them on my (or Karl's) latest git tree as I
already merged this patch.
Thanks.
--
Catalin
^ permalink raw reply
* Re: [StGit PATCH] Fixed default install location
From: Daniel White @ 2008-07-27 6:27 UTC (permalink / raw)
To: Catalin Marinas; +Cc: git
In-Reply-To: <b0943d9e0807251446w1e9ed73erfa7c1638191d88a@mail.gmail.com>
"Catalin Marinas" <catalin.marinas@gmail.com> wrote:
>
> I also use "python setup.py bdist_rpm" when releasing, I think it will
> get confused by a different prefix.
>
Not being familiar with distutils, I didn't even see that use case.
Regardless, the instructions are incorrect and the behaviour surprising.
When I installed this in a cygwin environment, it went on to clobber
my system directories.
Would it be more useful to have the Makefile handle the general case and
setup.py for more specialised cases, such as generating an rpm?
I've thrown some patches together that does some of this. I can tidy
these up and put them in a public repository if this sounds like a
reasonable plan of attack.
--
Daniel White
^ permalink raw reply
* [PATCH (GIT-GUI) 2/2] git-gui: Preserve scroll position on reshow_diff.
From: Alexander Gavrilov @ 2008-07-27 6:35 UTC (permalink / raw)
To: Shawn O. Pearce; +Cc: git
In-Reply-To: <200807271034.21833.angavrilov@gmail.com>
It is especially useful for Stage/Unstage Line, because
they invoke full state scan and diff reload, which originally
would reset the scroll position to the top of the file.
Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
---
lib/diff.tcl | 18 ++++++++++++++----
1 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/lib/diff.tcl b/lib/diff.tcl
index 96ba949..1c1aa56 100644
--- a/lib/diff.tcl
+++ b/lib/diff.tcl
@@ -19,6 +19,7 @@ proc clear_diff {} {
proc reshow_diff {} {
global file_states file_lists
global current_diff_path current_diff_side
+ global ui_diff
set p $current_diff_path
if {$p eq {}} {
@@ -28,7 +29,8 @@ proc reshow_diff {} {
|| [lsearch -sorted -exact $file_lists($current_diff_side) $p] == -1} {
clear_diff
} else {
- show_diff $p $current_diff_side
+ set save_pos [lindex [$ui_diff yview] 0]
+ show_diff $p $current_diff_side {} $save_pos
}
}
@@ -52,7 +54,7 @@ A rescan will be automatically started to find other files which may have the sa
rescan ui_ready 0
}
-proc show_diff {path w {lno {}}} {
+proc show_diff {path w {lno {}} {scroll_pos {}}} {
global file_states file_lists
global is_3way_diff diff_active repo_config
global ui_diff ui_index ui_workdir
@@ -151,6 +153,10 @@ proc show_diff {path w {lno {}}} {
$ui_diff conf -state disabled
set diff_active 0
unlock_index
+ if {$scroll_pos ne {}} {
+ update
+ $ui_diff yview moveto $scroll_pos
+ }
ui_ready
return
}
@@ -190,10 +196,10 @@ proc show_diff {path w {lno {}}} {
-blocking 0 \
-encoding binary \
-translation binary
- fileevent $fd readable [list read_diff $fd]
+ fileevent $fd readable [list read_diff $fd $scroll_pos]
}
-proc read_diff {fd} {
+proc read_diff {fd scroll_pos} {
global ui_diff diff_active
global is_3way_diff current_diff_header
@@ -282,6 +288,10 @@ proc read_diff {fd} {
close $fd
set diff_active 0
unlock_index
+ if {$scroll_pos ne {}} {
+ update
+ $ui_diff yview moveto $scroll_pos
+ }
ui_ready
if {[$ui_diff index end] eq {2.0}} {
--
1.5.6.3.18.gfe82
^ permalink raw reply related
* [PATCH (GIT-GUI) 1/2] git-gui: Fix the Remote menu separator.
From: Alexander Gavrilov @ 2008-07-27 6:34 UTC (permalink / raw)
To: Shawn O. Pearce; +Cc: git
It was positioned incorrectly (offset by one position)
if the menu had a tear-off handle.
Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
---
A couple of random fixes.
-- Alexander
git-gui.sh | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/git-gui.sh b/git-gui.sh
index 9d0627d..da903a1 100755
--- a/git-gui.sh
+++ b/git-gui.sh
@@ -2926,6 +2926,7 @@ if {[is_enabled transport]} {
populate_fetch_menu
set n [expr {[.mbar.remote index end] - $n}]
if {$n > 0} {
+ if {[.mbar.remote type 0] eq "tearoff"} { incr n }
.mbar.remote insert $n separator
}
unset n
--
1.5.6.3.18.gfe82
^ permalink raw reply related
* [PATCH (GITK) 6/6] gitk: Fallback to selecting the head commit upon load.
From: Alexander Gavrilov @ 2008-07-27 6:22 UTC (permalink / raw)
To: git; +Cc: Paul Mackerras
In-Reply-To: <200807271021.46661.angavrilov@gmail.com>
Date: Sat, 26 Jul 2008 20:15:54 +0400
Try selecting the head, if the previously selected commit
is not available in the new view.
Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
---
gitk | 25 ++++++++++++++++++-------
1 files changed, 18 insertions(+), 7 deletions(-)
diff --git a/gitk b/gitk
index 5021437..d093a39 100755
--- a/gitk
+++ b/gitk
@@ -1506,8 +1506,15 @@ proc chewcommits {} {
global numcommits startmsecs
if {[info exists pending_select]} {
- set row [first_real_row]
- selectline $row 1
+ update
+ reset_pending_select {}
+
+ if {[commitinview $pending_select $curview]} {
+ selectline [rowofcommit $pending_select] 1
+ } else {
+ set row [first_real_row]
+ selectline $row 1
+ }
}
if {$commitidx($curview) > 0} {
#set ms [expr {[clock clicks -milliseconds] - $startmsecs}]
@@ -3372,14 +3379,18 @@ proc showview {n} {
drawvisible
if {$row ne {}} {
selectline $row 0
- } elseif {$mainheadid ne {} && [commitinview $mainheadid $curview]} {
- selectline [rowofcommit $mainheadid] 1
} elseif {!$viewcomplete($n)} {
reset_pending_select $selid
} else {
- set row [first_real_row]
- if {$row < $numcommits} {
- selectline $row 0
+ reset_pending_select {}
+
+ if {[commitinview $pending_select $curview]} {
+ selectline [rowofcommit $pending_select] 1
+ } else {
+ set row [first_real_row]
+ if {$row < $numcommits} {
+ selectline $row 0
+ }
}
}
if {!$viewcomplete($n)} {
--
1.5.6.3.18.gfe82
^ permalink raw reply related
* [PATCH (GITK) 5/6] gitk: Fixed automatic row selection during load.
From: Alexander Gavrilov @ 2008-07-27 6:21 UTC (permalink / raw)
To: git; +Cc: Paul Mackerras
In-Reply-To: <200807271020.53171.angavrilov@gmail.com>
Date: Sat, 26 Jul 2008 20:13:45 +0400
- Switching views now actually preserves the selected commit.
- Reloading (also Edit View) preserves the currently selected commit.
- Initial selection does not produce weird scrolling.
Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
---
gitk | 41 ++++++++++++++++++++++++-----------------
1 files changed, 24 insertions(+), 17 deletions(-)
diff --git a/gitk b/gitk
index abb6542..5021437 100755
--- a/gitk
+++ b/gitk
@@ -307,7 +307,7 @@ proc start_rev_list {view} {
global viewargs viewargscmd viewfiles vfilelimit
global showlocalchanges commitinterest
global viewactive viewinstances vmergeonly
- global pending_select mainheadid
+ global mainheadid
global vcanopt vflags vrevs vorigargs
set startmsecs [clock clicks -milliseconds]
@@ -374,9 +374,6 @@ proc start_rev_list {view} {
}
filerun $fd [list getcommitlines $fd $i $view 0]
nowbusy $view [mc "Reading"]
- if {$view == $curview} {
- set pending_select $mainheadid
- }
set viewcomplete($view) 0
set viewactive($view) 1
return 1
@@ -418,11 +415,22 @@ proc stop_rev_list {view} {
set viewinstances($view) {}
}
-proc getcommits {} {
+proc reset_pending_select {selid} {
+ global pending_select mainheadid
+
+ if {$selid ne {}} {
+ set pending_select $selid
+ } else {
+ set pending_select $mainheadid
+ }
+}
+
+proc getcommits {selid} {
global canv curview need_redisplay viewactive
initlayout
if {[start_rev_list $curview]} {
+ reset_pending_select $selid
show_status [mc "Reading commits..."]
set need_redisplay 1
} else {
@@ -503,7 +511,7 @@ proc updatecommits {} {
filerun $fd [list getcommitlines $fd $i $view 1]
incr viewactive($view)
set viewcomplete($view) 0
- set pending_select $mainheadid
+ reset_pending_select {}
nowbusy $view "Reading"
if {$showneartags} {
getallcommits
@@ -515,6 +523,11 @@ proc reloadcommits {} {
global showneartags treediffs commitinterest cached_commitrow
global targetid
+ set selid {}
+ if {$selectedline ne {}} {
+ set selid $currentid
+ }
+
if {!$viewcomplete($curview)} {
stop_rev_list $curview
}
@@ -533,7 +546,7 @@ proc reloadcommits {} {
catch {unset cached_commitrow}
catch {unset targetid}
setcanvscroll
- getcommits
+ getcommits $selid
return 0
}
@@ -3325,10 +3338,7 @@ proc showview {n} {
run refill_reflist
if {![info exists viewcomplete($n)]} {
- if {$selid ne {}} {
- set pending_select $selid
- }
- getcommits
+ getcommits $selid
return
}
@@ -3365,11 +3375,7 @@ proc showview {n} {
} elseif {$mainheadid ne {} && [commitinview $mainheadid $curview]} {
selectline [rowofcommit $mainheadid] 1
} elseif {!$viewcomplete($n)} {
- if {$selid ne {}} {
- set pending_select $selid
- } else {
- set pending_select $mainheadid
- }
+ reset_pending_select $selid
} else {
set row [first_real_row]
if {$row < $numcommits} {
@@ -4036,6 +4042,7 @@ proc layoutmore {} {
}
if {[info exists pending_select] &&
[commitinview $pending_select $curview]} {
+ update
selectline [rowofcommit $pending_select] 1
}
drawvisible
@@ -9973,4 +9980,4 @@ if {[info exists permviews]} {
addviewmenu $n
}
}
-getcommits
+getcommits {}
--
1.5.6.3.18.gfe82
^ permalink raw reply related
* [PATCH (GITK) 4/6] gitk: Fixed broken exception handling in diff.
From: Alexander Gavrilov @ 2008-07-27 6:20 UTC (permalink / raw)
To: git; +Cc: Paul Mackerras
In-Reply-To: <200807271020.02415.angavrilov@gmail.com>
Date: Sat, 26 Jul 2008 18:48:41 +0400
If the tree diff command failed to start for some
random reason, treepending remained set, and thus
no more diffs were shown after that.
Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
---
gitk | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/gitk b/gitk
index d7fea26..abb6542 100755
--- a/gitk
+++ b/gitk
@@ -6457,9 +6457,10 @@ proc diffcmd {ids flags} {
proc gettreediffs {ids} {
global treediff treepending
+ if {[catch {set gdtf [open [diffcmd $ids {--no-commit-id}] r]}]} return
+
set treepending $ids
set treediff {}
- if {[catch {set gdtf [open [diffcmd $ids {--no-commit-id}] r]}]} return
fconfigure $gdtf -blocking 0
filerun $gdtf [list gettreediffline $gdtf $ids]
}
--
1.5.6.3.18.gfe82
^ permalink raw reply related
* [PATCH (GITK) 3/6] gitk: On Windows use a Cygwin-specific flag for kill.
From: Alexander Gavrilov @ 2008-07-27 6:20 UTC (permalink / raw)
To: git; +Cc: Paul Mackerras
In-Reply-To: <200807271019.17267.angavrilov@gmail.com>
Date: Tue, 15 Jul 2008 00:35:42 +0400
MSysGit compiles git binaries as native Windows executables,
so they cannot be killed unless a special flag is specified.
This flag is implemented by the Cygwin version of kill,
which is also included in MSysGit.
Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
---
gitk | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/gitk b/gitk
index b523c98..d7fea26 100755
--- a/gitk
+++ b/gitk
@@ -388,7 +388,12 @@ proc stop_instance {inst} {
set fd $commfd($inst)
catch {
set pid [pid $fd]
- exec kill $pid
+
+ if {$::tcl_platform(platform) eq {windows}} {
+ exec kill -f $pid
+ } else {
+ exec kill $pid
+ }
}
catch {close $fd}
nukefile $fd
--
1.5.6.3.18.gfe82
^ permalink raw reply related
* [PATCH (GITK) 2/6] gitk: Register diff-files & diff-index in commfd, to ensure kill.
From: Alexander Gavrilov @ 2008-07-27 6:19 UTC (permalink / raw)
To: git; +Cc: Paul Mackerras
In-Reply-To: <200807271018.22969.angavrilov@gmail.com>
Date: Sun, 13 Jul 2008 16:40:47 +0400
Local change analysis can take a noticeable amount of time on large
file sets, and produce no output if there are no changes. Register
the back-ends in commfd, so that they get properly killed on window
close.
Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
---
gitk | 39 +++++++++++++++++++++++----------------
1 files changed, 23 insertions(+), 16 deletions(-)
diff --git a/gitk b/gitk
index 29d79d6..b523c98 100755
--- a/gitk
+++ b/gitk
@@ -90,6 +90,15 @@ proc dorunq {} {
}
}
+proc reg_instance {fd} {
+ global commfd leftover loginstance
+
+ set i [incr loginstance]
+ set commfd($i) $fd
+ set leftover($i) {}
+ return $i
+}
+
proc unmerged_files {files} {
global nr_unmerged
@@ -294,10 +303,10 @@ proc parseviewrevs {view revs} {
# Start off a git log process and arrange to read its output
proc start_rev_list {view} {
global startmsecs commitidx viewcomplete curview
- global commfd leftover tclencoding
+ global tclencoding
global viewargs viewargscmd viewfiles vfilelimit
global showlocalchanges commitinterest
- global viewactive loginstance viewinstances vmergeonly
+ global viewactive viewinstances vmergeonly
global pending_select mainheadid
global vcanopt vflags vrevs vorigargs
@@ -354,10 +363,8 @@ proc start_rev_list {view} {
error_popup "[mc "Error executing git log:"] $err"
return 0
}
- set i [incr loginstance]
+ set i [reg_instance $fd]
set viewinstances($view) [list $i]
- set commfd($i) $fd
- set leftover($i) {}
if {$showlocalchanges && $mainheadid ne {}} {
lappend commitinterest($mainheadid) {dodiffindex}
}
@@ -420,8 +427,8 @@ proc getcommits {} {
proc updatecommits {} {
global curview vcanopt vorigargs vfilelimit viewinstances
- global viewactive viewcomplete loginstance tclencoding
- global startmsecs commfd showneartags showlocalchanges leftover
+ global viewactive viewcomplete tclencoding
+ global startmsecs showneartags showlocalchanges
global mainheadid pending_select
global isworktree
global varcid vposids vnegids vflags vrevs
@@ -482,10 +489,8 @@ proc updatecommits {} {
if {$viewactive($view) == 0} {
set startmsecs [clock clicks -milliseconds]
}
- set i [incr loginstance]
+ set i [reg_instance $fd]
lappend viewinstances($view) $i
- set commfd($i) $fd
- set leftover($i) {}
fconfigure $fd -blocking 0 -translation lf -eofchar {}
if {$tclencoding != {}} {
fconfigure $fd -encoding $tclencoding
@@ -4063,10 +4068,11 @@ proc dodiffindex {} {
incr lserial
set fd [open "|git diff-index --cached HEAD" r]
fconfigure $fd -blocking 0
- filerun $fd [list readdiffindex $fd $lserial]
+ set i [reg_instance $fd]
+ filerun $fd [list readdiffindex $fd $lserial $i]
}
-proc readdiffindex {fd serial} {
+proc readdiffindex {fd serial inst} {
global mainheadid nullid nullid2 curview commitinfo commitdata lserial
set isdiff 1
@@ -4077,7 +4083,7 @@ proc readdiffindex {fd serial} {
set isdiff 0
}
# we only need to see one line and we don't really care what it says...
- close $fd
+ stop_instance $inst
if {$serial != $lserial} {
return 0
@@ -4086,7 +4092,8 @@ proc readdiffindex {fd serial} {
# now see if there are any local changes not checked in to the index
set fd [open "|git diff-files" r]
fconfigure $fd -blocking 0
- filerun $fd [list readdifffiles $fd $serial]
+ set i [reg_instance $fd]
+ filerun $fd [list readdifffiles $fd $serial $i]
if {$isdiff && ![commitinview $nullid2 $curview]} {
# add the line for the changes in the index to the graph
@@ -4103,7 +4110,7 @@ proc readdiffindex {fd serial} {
return 0
}
-proc readdifffiles {fd serial} {
+proc readdifffiles {fd serial inst} {
global mainheadid nullid nullid2 curview
global commitinfo commitdata lserial
@@ -4115,7 +4122,7 @@ proc readdifffiles {fd serial} {
set isdiff 0
}
# we only need to see one line and we don't really care what it says...
- close $fd
+ stop_instance $inst
if {$serial != $lserial} {
return 0
--
1.5.6.3.18.gfe82
^ permalink raw reply related
* Re: git-scm.com
From: "Peter Valdemar Mørch (Lists)" @ 2008-07-27 6:19 UTC (permalink / raw)
To: git
In-Reply-To: <7vsktwfu5z.fsf@gitster.siamese.dyndns.org>
As a contributer with a single commit I was happy to see myself appear
shortly on the list (yeah!). Ok, so I realize it is vanity and a little
silly... :-)
Junio C Hamano gitster-at-pobox.com |Lists| wrote:
> I have a mild suspicion that sorting that list in alphabetical order may
> actually make it much better. It all depends on the purpose of that list,
> though.
To me it makes sense to sort the entire list according to commits. Its
still easy to find anybody with search, and I find it appropriate that I
be towards the end. The commit sorting encourages me to move up the
list! :-D
> And for the "giving credit" purpose, I do not think truncating the list at
> 5 commits or less threshold, as suggested earlier and already done, makes
> much sense, either.
And why truncate the list? I'd personally like to be back on the list
(vanity! - but true), bandwidth is relatively cheap, and there is
nothing below the list. I also think it makes the community look healty
and encourages contribution to see how many others contribute.
Peter
--
Peter Valdemar Mørch
http://www.morch.com
^ permalink raw reply
* [PATCH (GITK) 1/6] gitk: Kill back-end processes on window close.
From: Alexander Gavrilov @ 2008-07-27 6:18 UTC (permalink / raw)
To: git; +Cc: Paul Mackerras
In-Reply-To: <200807271017.23272.angavrilov@gmail.com>
Date: Sat, 12 Jul 2008 16:09:28 +0400
When collecting commits for a rarely changed, or recently
created file or directory, rev-list may work for a noticeable
period of time without producing any output. Such processes
don't receive SIGPIPE for a while after gitk is closed, thus
becoming runaway CPU hogs.
Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
---
gitk | 35 +++++++++++++++++++++++++----------
1 files changed, 25 insertions(+), 10 deletions(-)
diff --git a/gitk b/gitk
index fddcb45..29d79d6 100755
--- a/gitk
+++ b/gitk
@@ -375,19 +375,33 @@ proc start_rev_list {view} {
return 1
}
+proc stop_instance {inst} {
+ global commfd leftover
+
+ set fd $commfd($inst)
+ catch {
+ set pid [pid $fd]
+ exec kill $pid
+ }
+ catch {close $fd}
+ nukefile $fd
+ unset commfd($inst)
+ unset leftover($inst)
+}
+
+proc stop_backends {} {
+ global commfd
+
+ foreach inst [array names commfd] {
+ stop_instance $inst
+ }
+}
+
proc stop_rev_list {view} {
- global commfd viewinstances leftover
+ global viewinstances
foreach inst $viewinstances($view) {
- set fd $commfd($inst)
- catch {
- set pid [pid $fd]
- exec kill $pid
- }
- catch {close $fd}
- nukefile $fd
- unset commfd($inst)
- unset leftover($inst)
+ stop_instance $inst
}
set viewinstances($view) {}
}
@@ -2103,6 +2117,7 @@ proc makewindow {} {
bind . <$M1B-minus> {incrfont -1}
bind . <$M1B-KP_Subtract> {incrfont -1}
wm protocol . WM_DELETE_WINDOW doquit
+ bind . <Destroy> {stop_backends}
bind . <Button-1> "click %W"
bind $fstring <Key-Return> {dofind 1 1}
bind $sha1entry <Key-Return> gotocommit
--
1.5.6.3.18.gfe82
^ permalink raw reply related
* [PATCH (GITK) 0/6] Runaway process and commit selection fixes
From: Alexander Gavrilov @ 2008-07-27 6:17 UTC (permalink / raw)
To: git; +Cc: Paul Mackerras
This series includes three patches that I sent 8 days ago,
because I haven't received any reply so far.
These patches address the following problems:
1) Runaway processes (resend)
As in the 'git gui blame' case, gitk back-end processes can sometimes
run for a while without producing any output, e.g. diff-files on a slow
filesystem.
These patches make gitk explicitly kill its back-end processes.
2) Gitk stopping showing any diffs under random conditions.
3) Broken commit selection on view reload: gitk tried to preserve
the selected commit, but usually failed because of code rot.
I added selection preservation on Reload and Edit View.
Update still should reset the selection to HEAD if anything changed.
Also, if the previously selected commit was not found in the new view,
gitk should fall back to selecting HEAD.
Alexander Gavrilov (6):
gitk: Kill back-end processes on window close.
gitk: Register diff-files & diff-index in commfd, to ensure kill.
gitk: On Windows use a Cygwin-specific flag for kill.
gitk: Fixed broken exception handling in diff.
gitk: Fixed automatic row selection during load.
gitk: Fallback to selecting the head commit upon load.
gitk | 148 +++++++++++++++++++++++++++++++++++++++++++-----------------------
1 files changed, 97 insertions(+), 51 deletions(-)
^ permalink raw reply
* [PATCH] make sure parsed wildcard refspec ends with slash
From: Junio C Hamano @ 2008-07-27 6:15 UTC (permalink / raw)
To: Jeff King; +Cc: Daniel Barkalow, git
In-Reply-To: <7vvdysb2na.fsf@gitster.siamese.dyndns.org>
A wildcard refspec is internally parsed into a refspec structure with src
and dst strings. Many parts of the code assumed that these do not include
the trailing "/*" when matching the wildcard pattern with an actual ref we
see at the remote. What this meant was that we needed to make sure not
just that the prefix matched, and also that a slash followed the part that
matched.
But a codepath that scans the result from ls-remote and finds matching
refs forgot to check the "matching part must be followed by a slash" rule.
This resulted in "refs/heads/b1" from the remote side to mistakenly match
the source side of "refs/heads/b/*:refs/remotes/b/*" refspec.
Worse, the refspec crafted internally by "git-clone", and a hardcoded
preparsed refspec that is used to implement "git-fetch --tags", violated
this "parsed widcard refspec does not end with slash" rule; simply adding
the "matching part must be followed by a slash" rule then would have
broken codepaths that use these refspecs.
This commit changes the rule to require a trailing slash to parsed
wildcard refspecs. IOW, "refs/heads/b/*:refs/remotes/b/*" is parsed as
src = "refs/heads/b/" and dst = "refs/remotes/b/". This allows us to
simplify the matching logic because we only need to do a prefixcmp() to
notice "refs/heads/b/one" matches and "refs/heads/b1" does not.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
Junio C Hamano <gitster@pobox.com> writes:
> I have a nagging suspicion that it might be a simpler and cleaner change
> to change parse_refspec_internal() to keep the trailing slash, instead of
> dropping it. Then the check you added is not needed (the trailing slash
> guarantees that the pattern matches at the hierarchy boundary), neither
> any of the change in this patch.
This is the other variant, and it turns out that I was right. Among the
64-18 = 46 new lines, 30 are from the new test file. Two existing
"matching part is followed by '/'" tests are removed.
remote.c | 52 +++++++++++++++++++++++++++++++----------------
t/t5513-fetch-track.sh | 30 +++++++++++++++++++++++++++
2 files changed, 64 insertions(+), 18 deletions(-)
diff --git a/remote.c b/remote.c
index 0d6020b..f61a3ab 100644
--- a/remote.c
+++ b/remote.c
@@ -427,6 +427,28 @@ static void read_config(void)
alias_all_urls();
}
+/*
+ * We need to make sure the tracking branches are well formed, but a
+ * wildcard refspec in "struct refspec" must have a trailing slash. We
+ * temporarily drop the trailing '/' while calling check_ref_format(),
+ * and put it back. The caller knows that a CHECK_REF_FORMAT_ONELEVEL
+ * error return is Ok for a wildcard refspec.
+ */
+static int verify_refname(char *name, int is_glob)
+{
+ int result, len = -1;
+
+ if (is_glob) {
+ len = strlen(name);
+ assert(name[len - 1] == '/');
+ name[len - 1] = '\0';
+ }
+ result = check_ref_format(name);
+ if (is_glob)
+ name[len - 1] = '/';
+ return result;
+}
+
static struct refspec *parse_refspec_internal(int nr_refspec, const char **refspec, int fetch, int verify)
{
int i;
@@ -434,11 +456,11 @@ static struct refspec *parse_refspec_internal(int nr_refspec, const char **refsp
struct refspec *rs = xcalloc(sizeof(*rs), nr_refspec);
for (i = 0; i < nr_refspec; i++) {
- size_t llen, rlen;
+ size_t llen;
int is_glob;
const char *lhs, *rhs;
- llen = rlen = is_glob = 0;
+ llen = is_glob = 0;
lhs = refspec[i];
if (*lhs == '+') {
@@ -458,12 +480,9 @@ static struct refspec *parse_refspec_internal(int nr_refspec, const char **refsp
}
if (rhs) {
- rhs++;
- rlen = strlen(rhs);
+ size_t rlen = strlen(++rhs);
is_glob = (2 <= rlen && !strcmp(rhs + rlen - 2, "/*"));
- if (is_glob)
- rlen -= 2;
- rs[i].dst = xstrndup(rhs, rlen);
+ rs[i].dst = xstrndup(rhs, rlen - is_glob);
}
llen = (rhs ? (rhs - lhs - 1) : strlen(lhs));
@@ -471,7 +490,7 @@ static struct refspec *parse_refspec_internal(int nr_refspec, const char **refsp
if ((rhs && !is_glob) || (!rhs && fetch))
goto invalid;
is_glob = 1;
- llen -= 2;
+ llen--;
} else if (rhs && is_glob) {
goto invalid;
}
@@ -488,7 +507,7 @@ static struct refspec *parse_refspec_internal(int nr_refspec, const char **refsp
if (!*rs[i].src)
; /* empty is ok */
else {
- st = check_ref_format(rs[i].src);
+ st = verify_refname(rs[i].src, is_glob);
if (st && st != CHECK_REF_FORMAT_ONELEVEL)
goto invalid;
}
@@ -503,7 +522,7 @@ static struct refspec *parse_refspec_internal(int nr_refspec, const char **refsp
} else if (!*rs[i].dst) {
; /* ok */
} else {
- st = check_ref_format(rs[i].dst);
+ st = verify_refname(rs[i].dst, is_glob);
if (st && st != CHECK_REF_FORMAT_ONELEVEL)
goto invalid;
}
@@ -518,7 +537,7 @@ static struct refspec *parse_refspec_internal(int nr_refspec, const char **refsp
if (!*rs[i].src)
; /* empty is ok */
else if (is_glob) {
- st = check_ref_format(rs[i].src);
+ st = verify_refname(rs[i].src, is_glob);
if (st && st != CHECK_REF_FORMAT_ONELEVEL)
goto invalid;
}
@@ -532,13 +551,13 @@ static struct refspec *parse_refspec_internal(int nr_refspec, const char **refsp
* - otherwise it must be a valid looking ref.
*/
if (!rs[i].dst) {
- st = check_ref_format(rs[i].src);
+ st = verify_refname(rs[i].src, is_glob);
if (st && st != CHECK_REF_FORMAT_ONELEVEL)
goto invalid;
} else if (!*rs[i].dst) {
goto invalid;
} else {
- st = check_ref_format(rs[i].dst);
+ st = verify_refname(rs[i].dst, is_glob);
if (st && st != CHECK_REF_FORMAT_ONELEVEL)
goto invalid;
}
@@ -687,8 +706,7 @@ int remote_find_tracking(struct remote *remote, struct refspec *refspec)
if (!fetch->dst)
continue;
if (fetch->pattern) {
- if (!prefixcmp(needle, key) &&
- needle[strlen(key)] == '/') {
+ if (!prefixcmp(needle, key)) {
*result = xmalloc(strlen(value) +
strlen(needle) -
strlen(key) + 1);
@@ -966,9 +984,7 @@ static const struct refspec *check_pattern_match(const struct refspec *rs,
continue;
}
- if (rs[i].pattern &&
- !prefixcmp(src->name, rs[i].src) &&
- src->name[strlen(rs[i].src)] == '/')
+ if (rs[i].pattern && !prefixcmp(src->name, rs[i].src))
return rs + i;
}
if (matching_refs != -1)
diff --git a/t/t5513-fetch-track.sh b/t/t5513-fetch-track.sh
new file mode 100755
index 0000000..9e74862
--- /dev/null
+++ b/t/t5513-fetch-track.sh
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+test_description='fetch follows remote tracking branches correctly'
+
+. ./test-lib.sh
+
+test_expect_success setup '
+ >file &&
+ git add . &&
+ test_tick &&
+ git commit -m Initial &&
+ git branch b-0 &&
+ git branch b1 &&
+ git branch b/one &&
+ test_create_repo other &&
+ (
+ cd other &&
+ git config remote.origin.url .. &&
+ git config remote.origin.fetch "+refs/heads/b/*:refs/remotes/b/*"
+ )
+'
+
+test_expect_success fetch '
+ (
+ cd other && git fetch origin &&
+ test "$(git for-each-ref --format="%(refname)")" = refs/remotes/b/one
+ )
+'
+
+test_done
^ permalink raw reply related
* Re: [PATCH v2] t6030 (bisect): work around Mac OS X "ls"
From: Christian Couder @ 2008-07-27 5:10 UTC (permalink / raw)
To: Jonathan Nieder; +Cc: git
In-Reply-To: <Pine.GSO.4.62.0807262343510.426@harper.uchicago.edu>
Le dimanche 27 juillet 2008, Jonathan Nieder a écrit :
> t6030-bisect-porcelain.sh relies on "ls" exiting with nonzero
> status when asked to list nonexistent files. Unfortunately,
> /bin/ls on Mac OS X 10.3 exits with exit code 0. So look at
> its output instead.
>
> Signed-off-by: Jonathan Nieder <jrnieder@uchicago.edu>
> Acked-by: Christian Couder <chriscool@tuxfamily.org>
> ---
>
> On Sun, 27 Jul 2008, Christian Couder wrote:
> > It seems that there is a problem with the message itself though. When I
> > "git am" it, I get:
> >
> > fatal: cannot convert from x-unknown to utf-8
>
> Hmm, not sure what happened. Maybe resending it will work...
Yes, this one works fine.
Thanks,
Christian.
>
> t/t6030-bisect-porcelain.sh | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/t/t6030-bisect-porcelain.sh b/t/t6030-bisect-porcelain.sh
> index 0626544..244fda6 100755
> --- a/t/t6030-bisect-porcelain.sh
> +++ b/t/t6030-bisect-porcelain.sh
> @@ -76,7 +76,7 @@ test_expect_success 'bisect fails if given any junk
> instead of revs' ' test_must_fail git bisect start foo $HASH1 -- &&
> test_must_fail git bisect start $HASH4 $HASH1 bar -- &&
> test -z "$(git for-each-ref "refs/bisect/*")" &&
> - test_must_fail ls .git/BISECT_* &&
> + test -z "$(ls .git/BISECT_* 2>/dev/null)" &&
> git bisect start &&
> test_must_fail git bisect good foo $HASH1 &&
> test_must_fail git bisect good $HASH1 bar &&
^ permalink raw reply
* [PATCH v2] t6030 (bisect): work around Mac OS X "ls"
From: Jonathan Nieder @ 2008-07-27 4:53 UTC (permalink / raw)
To: Christian Couder; +Cc: git
In-Reply-To: <200807270604.16581.chriscool@tuxfamily.org>
t6030-bisect-porcelain.sh relies on "ls" exiting with nonzero
status when asked to list nonexistent files. Unfortunately,
/bin/ls on Mac OS X 10.3 exits with exit code 0. So look at
its output instead.
Signed-off-by: Jonathan Nieder <jrnieder@uchicago.edu>
Acked-by: Christian Couder <chriscool@tuxfamily.org>
---
On Sun, 27 Jul 2008, Christian Couder wrote:
> It seems that there is a problem with the message itself though. When I "git
> am" it, I get:
>
> fatal: cannot convert from x-unknown to utf-8
Hmm, not sure what happened. Maybe resending it will work...
t/t6030-bisect-porcelain.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/t/t6030-bisect-porcelain.sh b/t/t6030-bisect-porcelain.sh
index 0626544..244fda6 100755
--- a/t/t6030-bisect-porcelain.sh
+++ b/t/t6030-bisect-porcelain.sh
@@ -76,7 +76,7 @@ test_expect_success 'bisect fails if given any junk instead of revs' '
test_must_fail git bisect start foo $HASH1 -- &&
test_must_fail git bisect start $HASH4 $HASH1 bar -- &&
test -z "$(git for-each-ref "refs/bisect/*")" &&
- test_must_fail ls .git/BISECT_* &&
+ test -z "$(ls .git/BISECT_* 2>/dev/null)" &&
git bisect start &&
test_must_fail git bisect good foo $HASH1 &&
test_must_fail git bisect good $HASH1 bar &&
--
1.5.5.1.328.gbfcc6
^ permalink raw reply related
* Re: [RFC/PATCH v2] merge-base: teach "git merge-base" to accept more than 2 arguments
From: Junio C Hamano @ 2008-07-27 4:47 UTC (permalink / raw)
To: Christian Couder; +Cc: git, Johannes Schindelin, Miklos Vajna
In-Reply-To: <20080727053324.b54fe48e.chriscool@tuxfamily.org>
Christian Couder <chriscool@tuxfamily.org> writes:
> OPTIONS
> -------
> --all::
> - Output all common ancestors for the two commits instead of
> - just one.
> + Output all merge bases for the commits instead of just one. No
> + merge bases in the output should be an ancestor of another
> + merge base in the output. Each common ancestor of the first
> + commit and any of the other commits passed as arguments,
> + should be an ancestor of one of the merge bases in the output.
The point of merge_bases_many() is that it allows you to compute a merge
base between a commit and another commit that does not yet exist which is
a merge across all others.
o---o---o---o---C
/ :
/ o---o---o---B..(M)
/ / :
---o---*---o---o---o---A..(X)
Suppose you have commits A, B and C, and you would want to come up with an
Octopus merge X across these three commits. Because our low-level merge
machinery works always on two trees with one common ancestor tree, we
would first create a tree that is a merge between B and C (which is marked
as (M) in the picture), and then merge the tree of (M) and A using common
ancestor between (M) and A.
If we did not have merge_bases_many(), we would actually create (M) as a
real commit, and compute merge base between A and (M), which is marked as
"*" in the picture. The use of merge_bases_many() allows us to run the
same merge base computation without actually creating commit (M). Instead
of computing merge-base between A and (M), you can ask for the merge base
between A ("the first commit") and B, C ("the other commits") to obtain
the same answer "*".
Base between A and B is that "*", and you are correct to say that it is an
ancestor of the "*" that is output from the command; base between A and C
is the parent of "*", and again you are correct to say it is ancestor of
the "*" that is output from the command.
But if we output any other commit between "*" and A from the command, it
still satisifies your condition. "The merge base between A and each of B,
C,... should be an ancestor of what is output". In order to satisify your
condition, in the extreme case, we could even output A. Both the merge
base between A and B, and the merge base between A and C, would be an
ancestor of A.
So your description may not be incorrect, but I think it completely misses
the point of what is being computed.
> Author
> ------
> diff --git a/builtin-merge-base.c b/builtin-merge-base.c
> index 1cb2925..f2c9756 100644
> --- a/builtin-merge-base.c
> +++ b/builtin-merge-base.c
> @@ -2,9 +2,11 @@
> #include "cache.h"
> #include "commit.h"
>
> -static int show_merge_base(struct commit *rev1, struct commit *rev2, int show_all)
> +static int show_merge_base(struct commit *rev1, int prev2_nr,
> + struct commit **prev2, int show_all)
> {
> - struct commit_list *result = get_merge_bases(rev1, rev2, 0);
> + struct commit_list *result = get_merge_bases_many(rev1, prev2_nr,
> + prev2, 0);
This is just style, but if you must break lines somewhere, I'd prefer to
have prev2_nr and prev2 on the same line, like this:
struct commit_list *result = get_merge_bases_many(rev1,
prev2_nr, prev2, 0);
because they logically belong to each other. Further, I think this
84-column single-line statement is perfectly fine as well in this case:
struct commit_list *result = get_merge_bases_many(rev1, prev2_nr, prev2, 0);
I would probably do this myself in this case, though:
struct commit_list *result;
result = get_merge_bases_many(rev1, prev2_nr, prev2, 0);
^ permalink raw reply
* [JGIT PATCH 2/2] Teach fetch command line a --verbose/-v switch for unchanged refs
From: Shawn O. Pearce @ 2008-07-27 4:33 UTC (permalink / raw)
To: Robin Rosenberg, Marek Zawirski; +Cc: git
In-Reply-To: <1217133221-15513-1-git-send-email-spearce@spearce.org>
We normally don't want to know about unchanged refs, as these
are not very interesting. We now skip showing them by default
and only produce an output line for unchanged refs if -v is
given to us on the command line.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
---
.../src/org/spearce/jgit/pgm/Fetch.java | 18 +++++++++++++++---
1 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/org.spearce.jgit.pgm/src/org/spearce/jgit/pgm/Fetch.java b/org.spearce.jgit.pgm/src/org/spearce/jgit/pgm/Fetch.java
index 194f669..84b5258 100644
--- a/org.spearce.jgit.pgm/src/org/spearce/jgit/pgm/Fetch.java
+++ b/org.spearce.jgit.pgm/src/org/spearce/jgit/pgm/Fetch.java
@@ -40,6 +40,7 @@ package org.spearce.jgit.pgm;
import java.util.List;
import org.kohsuke.args4j.Argument;
+import org.kohsuke.args4j.Option;
import org.spearce.jgit.lib.RefUpdate;
import org.spearce.jgit.lib.TextProgressMonitor;
import org.spearce.jgit.transport.FetchResult;
@@ -48,6 +49,9 @@ import org.spearce.jgit.transport.TrackingRefUpdate;
import org.spearce.jgit.transport.Transport;
class Fetch extends TextBuiltin {
+ @Option(name = "--verbose", aliases = { "-v" }, usage = "be more verbose")
+ private boolean verbose;
+
@Argument(index = 0, metaVar = "uri-ish")
private String remote = "origin";
@@ -66,15 +70,23 @@ class Fetch extends TextBuiltin {
tn.close();
}
- out.print("From ");
- out.print(tn.getURI());
- out.println();
+ boolean shownURI = false;
for (final TrackingRefUpdate u : r.getTrackingRefUpdates()) {
+ if (!verbose && u.getResult() == RefUpdate.Result.NO_CHANGE)
+ continue;
+
final char type = shortTypeOf(u.getResult());
final String longType = longTypeOf(u);
final String src = abbreviateRef(u.getRemoteName(), false);
final String dst = abbreviateRef(u.getLocalName(), true);
+ if (!shownURI) {
+ out.print("From ");
+ out.print(tn.getURI());
+ out.println();
+ shownURI = true;
+ }
+
out.format(" %c %-17s %-10s -> %s", type, longType, src, dst);
out.println();
}
--
1.6.0.rc0.182.gb96c7
^ permalink raw reply related
* [JGIT PATCH 1/2] Fix missing packed-refs entries during ref lookup/enumeration
From: Shawn O. Pearce @ 2008-07-27 4:33 UTC (permalink / raw)
To: Robin Rosenberg, Marek Zawirski; +Cc: git
Some codepaths in RefDatabase allowed the caller to lookup a ref
without making sure the packed-refs file was loaded into memory.
This caused refs which were only packed to appear to not exist,
which meant fetch would still try to fetch something we already
have had for quite some time.
This resolves the issue I was seeing where `jgit fetch` was always
downloading the stable branch of egit.git, even though it has not
changed in many weeks.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
---
.../src/org/spearce/jgit/lib/RefDatabase.java | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/RefDatabase.java b/org.spearce.jgit/src/org/spearce/jgit/lib/RefDatabase.java
index 82b995e..98c365e 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/lib/RefDatabase.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/RefDatabase.java
@@ -115,6 +115,7 @@ class RefDatabase {
}
ObjectId idOf(final String name) throws IOException {
+ refreshPackedRefs();
final Ref r = readRefBasic(name, 0);
return r != null ? r.getObjectId() : null;
}
@@ -132,6 +133,7 @@ class RefDatabase {
* to the base ref, as the symbolic ref could not be read.
*/
RefUpdate newUpdate(final String name) throws IOException {
+ refreshPackedRefs();
Ref r = readRefBasic(name, 0);
if (r == null)
r = new Ref(Ref.Storage.NEW, name, null);
--
1.6.0.rc0.182.gb96c7
^ permalink raw reply related
* Re: [PATCH] fsck: Don't require tmp_obj_ file names are 14 bytes in length
From: Junio C Hamano @ 2008-07-27 4:15 UTC (permalink / raw)
To: Shawn O. Pearce; +Cc: git, Brandon Casey
In-Reply-To: <20080727023300.GB17425@spearce.org>
"Shawn O. Pearce" <spearce@spearce.org> writes:
> Brandon Casey <casey@nrlssc.navy.mil> wrote:
> > Since 5723fe7e, temporary objects are now created in their final destination
> > directories, rather than in .git/objects/. Teach fsck to recognize and
> > ignore the temporary objects it encounters, and teach prune to remove them.
>
> jgit can't exactly follow the 14 character naming rule.
> This should be a safe way around it.
More importantly, we might want to change the temporary filename to ensure
that it is 38 bytes in length in the future (cf. $gmane/85106).
^ permalink raw reply
* [JGIT PATCH 1/1] Compile all Java sources in jgit as UTF-8
From: Shawn O. Pearce @ 2008-07-27 4:11 UTC (permalink / raw)
To: Robin Rosenberg, Marek Zawirski; +Cc: git
We use a UTF-8 encoding in our source files whenever possible.
If the compiler assumes ASCII we sometimes get warnings parsing
copyright information for authors whose names aren't representable
in US-ASCII.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
---
make_jgit.sh | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/make_jgit.sh b/make_jgit.sh
index 89df80c..13d0e32 100755
--- a/make_jgit.sh
+++ b/make_jgit.sh
@@ -58,6 +58,7 @@ do
xargs javac \
-source 1.5 \
-target 1.5 \
+ -encoding UTF-8 \
-g \
-d ../bin2) || die "Building $p failed."
CLASSPATH="$CLASSPATH:$R/$p/bin2"
--
1.6.0.rc0.182.gb96c7
^ permalink raw reply related
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