From 54906addfa598640a6492cae1015badefa1ce201 Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Thu, 3 Apr 2008 18:06:29 -0400 Subject: [PATCH 01/14] git-gui: Switch keybindings for [ and ] to bracketleft and bracketright Thanks to Michele Ballabio for the quick fix. This resolves the error introduced by c91ee2bd61. Signed-off-by: Shawn O. Pearce --- git-gui.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/git-gui.sh b/git-gui.sh index 8225cec505..748efcc30c 100755 --- a/git-gui.sh +++ b/git-gui.sh @@ -2715,8 +2715,8 @@ bind $ui_comm <$M1B-Key-v> {tk_textPaste %W; %W see insert; break} bind $ui_comm <$M1B-Key-V> {tk_textPaste %W; %W see insert; break} bind $ui_comm <$M1B-Key-a> {%W tag add sel 0.0 end;break} bind $ui_comm <$M1B-Key-A> {%W tag add sel 0.0 end;break} -bind $ui_comm <$M1B-Key-\[> {show_less_context;break} -bind $ui_comm <$M1B-Key-\]> {show_more_context;break} +bind $ui_comm <$M1B-Key-bracketleft> {show_less_context;break} +bind $ui_comm <$M1B-Key-bracketright> {show_more_context;break} bind $ui_diff <$M1B-Key-x> {tk_textCopy %W;break} bind $ui_diff <$M1B-Key-X> {tk_textCopy %W;break} @@ -2760,8 +2760,8 @@ bind . <$M1B-Key-t> do_add_selection bind . <$M1B-Key-T> do_add_selection bind . <$M1B-Key-i> do_add_all bind . <$M1B-Key-I> do_add_all -bind . <$M1B-Key-\[> {show_less_context;break} -bind . <$M1B-Key-\]> {show_more_context;break} +bind . <$M1B-Key-bracketleft> {show_less_context;break} +bind . <$M1B-Key-bracketright> {show_more_context;break} bind . <$M1B-Key-Return> do_commit foreach i [list $ui_index $ui_workdir] { bind $i "toggle_or_diff $i %x %y; break" From ccb3b537cc847791c0e28c72ee1f9e6e807f2f6f Mon Sep 17 00:00:00 2001 From: Christian Couder Date: Sat, 5 Apr 2008 04:20:23 +0200 Subject: [PATCH 02/14] git-gui: Update french translation Signed-off-by: Shawn O. Pearce --- po/fr.po | 78 ++++++++++++++++++++++++-------------------------------- 1 file changed, 33 insertions(+), 45 deletions(-) diff --git a/po/fr.po b/po/fr.po index d281938e33..89b6d51ea0 100644 --- a/po/fr.po +++ b/po/fr.po @@ -9,7 +9,7 @@ msgstr "" "Project-Id-Version: fr\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2008-03-14 07:18+0100\n" -"PO-Revision-Date: 2008-01-14 21:08+0100\n" +"PO-Revision-Date: 2008-04-04 22:05+0200\n" "Last-Translator: Christian Couder \n" "Language-Team: French\n" "MIME-Version: 1.0\n" @@ -344,8 +344,7 @@ msgstr "Documentation en ligne" #: git-gui.sh:2238 #, tcl-format msgid "fatal: cannot stat path %s: No such file or directory" -msgstr "" -"fatale : pas d'infos sur le chemin %s : Fichier ou répertoire inexistant" +msgstr "erreur fatale : pas d'infos sur le chemin %s : Fichier ou répertoire inexistant" #: git-gui.sh:2271 msgid "Current Branch:" @@ -630,8 +629,7 @@ msgstr "Merci de choisir une branche de suivi" #: lib/branch_create.tcl:140 #, tcl-format msgid "Tracking branch %s is not a branch in the remote repository." -msgstr "" -"La branche de suivi %s n'est pas une branche dans le référentiel distant." +msgstr "La branche de suivi %s n'est pas une branche dans le référentiel distant." #: lib/branch_create.tcl:153 lib/branch_rename.tcl:86 msgid "Please supply a branch name." @@ -751,7 +749,7 @@ msgstr "Récupération de %s à partir de %s" #: lib/checkout_op.tcl:127 #, tcl-format msgid "fatal: Cannot resolve %s" -msgstr "Erreur fatale : Impossible de résoudre %s" +msgstr "erreur fatale : Impossible de résoudre %s" #: lib/checkout_op.tcl:140 lib/console.tcl:81 lib/database.tcl:31 msgid "Close" @@ -798,12 +796,9 @@ msgid "" "\n" "The rescan will be automatically started now.\n" msgstr "" -"L'état lors de la dernière synchronisation ne correspond plus à l'état du " -"référentiel.\n" +"L'état lors de la dernière synchronisation ne correspond plus à l'état du référentiel.\n" "\n" -"Un autre programme Git a modifié ce référentiel depuis la dernière " -"synchronisation. Une resynchronisation doit être effectuée avant de pouvoir " -"modifier la branche courante.\n" +"Un autre programme Git a modifié ce référentiel depuis la dernière synchronisation. Une resynchronisation doit être effectuée avant de pouvoir modifier la branche courante.\n" "\n" "Cela va être fait tout de suite automatiquement.\n" @@ -814,13 +809,12 @@ msgstr "Mise à jour du répertoire courant avec '%s'..." #: lib/checkout_op.tcl:323 msgid "files checked out" -msgstr "" +msgstr "fichiers empruntés" #: lib/checkout_op.tcl:353 #, tcl-format msgid "Aborted checkout of '%s' (file level merging is required)." -msgstr "" -"Emprunt de '%s' abandonné. (Il est nécessaire de fusionner des fichiers.)" +msgstr "Emprunt de '%s' abandonné. (Il est nécessaire de fusionner des fichiers.)" #: lib/checkout_op.tcl:354 msgid "File level merge required." @@ -1089,8 +1083,7 @@ msgstr "" #: lib/choose_repository.tcl:880 msgid "Cannot determine HEAD. See console output for details." -msgstr "" -"Impossible de déterminer HEAD. Voir la sortie console pour plus de détails." +msgstr "Impossible de déterminer HEAD. Voir la sortie console pour plus de détails." #: lib/choose_repository.tcl:889 #, tcl-format @@ -1292,32 +1285,31 @@ msgstr "attention : Tcl ne supporte pas l'encodage '%s'." #: lib/commit.tcl:221 msgid "Calling pre-commit hook..." -msgstr "" +msgstr "Appel du programme externe d'avant commit..." #: lib/commit.tcl:236 msgid "Commit declined by pre-commit hook." -msgstr "" +msgstr "Commit refusé par le programme externe d'avant commit." #: lib/commit.tcl:259 msgid "Calling commit-msg hook..." -msgstr "" +msgstr "Appel du programme externe de message de commit..." #: lib/commit.tcl:274 msgid "Commit declined by commit-msg hook." -msgstr "" +msgstr "Commit refusé par le programme externe de message de commit." #: lib/commit.tcl:287 msgid "Committing changes..." -msgstr "" +msgstr "Commit des modifications..." #: lib/commit.tcl:303 msgid "write-tree failed:" msgstr "write-tree a échoué :" #: lib/commit.tcl:304 lib/commit.tcl:348 lib/commit.tcl:368 -#, fuzzy msgid "Commit failed." -msgstr "Le clonage a échoué." +msgstr "Le commit a échoué." #: lib/commit.tcl:321 #, tcl-format @@ -1479,8 +1471,7 @@ msgstr "Erreur lors du chargement des différences :" #: lib/diff.tcl:303 msgid "Failed to unstage selected hunk." -msgstr "" -"La suppression dans le pré-commit de la section sélectionnée a échouée." +msgstr "La suppression dans le pré-commit de la section sélectionnée a échouée." #: lib/diff.tcl:310 msgid "Failed to stage selected hunk." @@ -1510,8 +1501,7 @@ msgstr "Erreur de pré-commit" msgid "" "Updating the Git index failed. A rescan will be automatically started to " "resynchronize git-gui." -msgstr "" -"Le pré-commit a échoué. Une resynchronisation va être lancée automatiquement." +msgstr "Le pré-commit a échoué. Une resynchronisation va être lancée automatiquement." #: lib/index.tcl:27 msgid "Continue" @@ -1527,9 +1517,8 @@ msgid "Unstaging %s from commit" msgstr "Supprimer %s du commit" #: lib/index.tcl:313 -#, fuzzy msgid "Ready to commit." -msgstr "Pré-commité" +msgstr "Prêt à être commité." #: lib/index.tcl:326 #, tcl-format @@ -1627,9 +1616,9 @@ msgid "%s of %s" msgstr "%s de %s" #: lib/merge.tcl:119 -#, fuzzy, tcl-format +#, tcl-format msgid "Merging %s and %s..." -msgstr "Fusion de %s et %s" +msgstr "Fusion de %s et %s..." #: lib/merge.tcl:130 msgid "Merge completed successfully." @@ -1693,9 +1682,8 @@ msgid "Aborting" msgstr "Abandon" #: lib/merge.tcl:238 -#, fuzzy msgid "files reset" -msgstr "fichiers" +msgstr "fichiers réinitialisés" #: lib/merge.tcl:265 msgid "Abort failed." @@ -1759,9 +1747,8 @@ msgid "Number of Diff Context Lines" msgstr "Nombre de lignes de contexte dans les diffs" #: lib/option.tcl:127 -#, fuzzy msgid "Commit Message Text Width" -msgstr "Message de commit :" +msgstr "Largeur du texte de message de commit" #: lib/option.tcl:128 msgid "New Branch Name Template" @@ -1769,7 +1756,7 @@ msgstr "Nouveau modèle de nom de branche" #: lib/option.tcl:192 msgid "Spelling Dictionary:" -msgstr "" +msgstr "Dictionnaire d'orthographe :" #: lib/option.tcl:216 msgid "Change Font" @@ -1898,40 +1885,40 @@ msgstr "Impossible d'écrire l'icône :" #: lib/spellcheck.tcl:57 msgid "Unsupported spell checker" -msgstr "" +msgstr "Vérificateur d'orthographe non supporté" #: lib/spellcheck.tcl:65 msgid "Spell checking is unavailable" -msgstr "" +msgstr "La vérification d'orthographe n'est pas disponible" #: lib/spellcheck.tcl:68 msgid "Invalid spell checking configuration" -msgstr "" +msgstr "Configuration de vérification d'orthographe invalide" #: lib/spellcheck.tcl:70 #, tcl-format msgid "Reverting dictionary to %s." -msgstr "" +msgstr "Réinitialisation du dictionnaire à %s." #: lib/spellcheck.tcl:73 msgid "Spell checker silently failed on startup" -msgstr "" +msgstr "La vérification d'orthographe a échouée silentieusement au démarrage" #: lib/spellcheck.tcl:80 msgid "Unrecognized spell checker" -msgstr "" +msgstr "Vérificateur d'orthographe non reconnu" #: lib/spellcheck.tcl:180 msgid "No Suggestions" -msgstr "" +msgstr "Aucune suggestion" #: lib/spellcheck.tcl:381 msgid "Unexpected EOF from spell checker" -msgstr "" +msgstr "Fin de fichier innatendue envoyée par le vérificateur d'orthographe" #: lib/spellcheck.tcl:385 msgid "Spell Checker Failed" -msgstr "" +msgstr "Le vérificateur d'orthographe a échoué" #: lib/status_bar.tcl:83 #, tcl-format @@ -2002,3 +1989,4 @@ msgstr "Utiliser des petits paquets (pour les connexions lentes)" #: lib/transport.tcl:168 msgid "Include tags" msgstr "Inclure les marques" + From 729ffa50f75a025935623bfc58d0932c65f7de2f Mon Sep 17 00:00:00 2001 From: Michele Ballabio Date: Fri, 4 Apr 2008 23:04:42 +0200 Subject: [PATCH 03/14] git-gui: use +/- instead of ]/[ to show more/less context in diff On some systems, brackets cannot be used as event details (they don't have a keysym), so use +/- instead (both on keyboard and keypad) and add ctrl-= as a synonym of ctrl-+ for convenience. [sp: Had to change accelerator to show only "$M1T-="; the original version included "$M1T-+ $M1T-=" but this is not drawn at all on Mac OS X.] Signed-off-by: Michele Ballabio Signed-off-by: Shawn O. Pearce --- git-gui.sh | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/git-gui.sh b/git-gui.sh index 748efcc30c..7c25bb9808 100755 --- a/git-gui.sh +++ b/git-gui.sh @@ -2064,11 +2064,11 @@ if {[is_enabled multicommit] || [is_enabled singlecommit]} { .mbar.commit add command -label [mc "Show Less Context"] \ -command show_less_context \ - -accelerator $M1T-\[ + -accelerator $M1T-\- .mbar.commit add command -label [mc "Show More Context"] \ -command show_more_context \ - -accelerator $M1T-\] + -accelerator $M1T-= .mbar.commit add separator @@ -2715,8 +2715,11 @@ bind $ui_comm <$M1B-Key-v> {tk_textPaste %W; %W see insert; break} bind $ui_comm <$M1B-Key-V> {tk_textPaste %W; %W see insert; break} bind $ui_comm <$M1B-Key-a> {%W tag add sel 0.0 end;break} bind $ui_comm <$M1B-Key-A> {%W tag add sel 0.0 end;break} -bind $ui_comm <$M1B-Key-bracketleft> {show_less_context;break} -bind $ui_comm <$M1B-Key-bracketright> {show_more_context;break} +bind $ui_comm <$M1B-Key-minus> {show_less_context;break} +bind $ui_comm <$M1B-Key-KP_Subtract> {show_less_context;break} +bind $ui_comm <$M1B-Key-equal> {show_more_context;break} +bind $ui_comm <$M1B-Key-plus> {show_more_context;break} +bind $ui_comm <$M1B-Key-KP_Add> {show_more_context;break} bind $ui_diff <$M1B-Key-x> {tk_textCopy %W;break} bind $ui_diff <$M1B-Key-X> {tk_textCopy %W;break} @@ -2760,8 +2763,11 @@ bind . <$M1B-Key-t> do_add_selection bind . <$M1B-Key-T> do_add_selection bind . <$M1B-Key-i> do_add_all bind . <$M1B-Key-I> do_add_all -bind . <$M1B-Key-bracketleft> {show_less_context;break} -bind . <$M1B-Key-bracketright> {show_more_context;break} +bind . <$M1B-Key-minus> {show_less_context;break} +bind . <$M1B-Key-KP_Subtract> {show_less_context;break} +bind . <$M1B-Key-equal> {show_more_context;break} +bind . <$M1B-Key-plus> {show_more_context;break} +bind . <$M1B-Key-KP_Add> {show_more_context;break} bind . <$M1B-Key-Return> do_commit foreach i [list $ui_index $ui_workdir] { bind $i "toggle_or_diff $i %x %y; break" From 4ed4a347168d6714c6beca7d7702473229c9d8f1 Mon Sep 17 00:00:00 2001 From: Jakub Narebski Date: Sat, 5 Apr 2008 21:13:24 +0100 Subject: [PATCH 04/14] Revert "gitweb: Add 'status_str' to parse_difftree_raw_line output" This reverts commit 6aa6f92fda47cc4ee5f599895e8a5a327fb6f9ab. It caused is_deleted() subroutine to output warnings when dealing with old, legacy gitweb blobdiff URLs without either 'hb' or 'hpb' parameters. This fixes http://bugs.debian.org/469083 Signed-off-by: Jakub Narebski Signed-off-by: Junio C Hamano --- gitweb/gitweb.perl | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index ec73cb1256..73d098a433 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -2164,7 +2164,7 @@ sub parse_difftree_raw_line { $res{'to_mode'} = $2; $res{'from_id'} = $3; $res{'to_id'} = $4; - $res{'status'} = $res{'status_str'} = $5; + $res{'status'} = $5; $res{'similarity'} = $6; if ($res{'status'} eq 'R' || $res{'status'} eq 'C') { # renamed or copied ($res{'from_file'}, $res{'to_file'}) = map { unquote($_) } split("\t", $7); @@ -2180,7 +2180,6 @@ sub parse_difftree_raw_line { $res{'to_mode'} = pop @{$res{'from_mode'}}; $res{'from_id'} = [ split(' ', $3) ]; $res{'to_id'} = pop @{$res{'from_id'}}; - $res{'status_str'} = $4; $res{'status'} = [ split('', $4) ]; $res{'to_file'} = unquote($5); } @@ -3002,7 +3001,7 @@ sub fill_from_file_info { sub is_deleted { my $diffinfo = shift; - return $diffinfo->{'status_str'} =~ /D/; + return $diffinfo->{'to_id'} eq ('0' x 40); } # does patch correspond to [previous] difftree raw line From f53423b0e09d0de9584f72ac298bdfdc9e886d73 Mon Sep 17 00:00:00 2001 From: Kevin Ballard Date: Sat, 5 Apr 2008 14:28:53 -0400 Subject: [PATCH 05/14] git-fetch: Don't trigger a bus error when given the refspec "tag" When git-fetch encounters the refspec "tag" it assumes that the next argument will be a tag name. If there is no next argument, it should die gracefully instead of erroring. Signed-off-by: Kevin Ballard Signed-off-by: Junio C Hamano --- builtin-fetch.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/builtin-fetch.c b/builtin-fetch.c index a11548c894..5841b3e51a 100644 --- a/builtin-fetch.c +++ b/builtin-fetch.c @@ -637,6 +637,8 @@ int cmd_fetch(int argc, const char **argv, const char *prefix) if (!strcmp(argv[i], "tag")) { char *ref; i++; + if (i >= argc) + die("You need to specify a tag name."); ref = xmalloc(strlen(argv[i]) * 2 + 22); strcpy(ref, "refs/tags/"); strcat(ref, argv[i]); From ba1333fec3df7496839106ee8730939d100d989d Mon Sep 17 00:00:00 2001 From: Peter Eriksen Date: Sat, 5 Apr 2008 21:46:49 +0200 Subject: [PATCH 06/14] git-pack-objects.txt: Make wording slightly less ambiguous It is a bit confusing on first read, that "The packed archive format (.pack) is designed to be unpackable..." Signed-off-by: Peter Eriksen Signed-off-by: Junio C Hamano --- Documentation/git-pack-objects.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Documentation/git-pack-objects.txt b/Documentation/git-pack-objects.txt index eed0a94c6e..3a1be08186 100644 --- a/Documentation/git-pack-objects.txt +++ b/Documentation/git-pack-objects.txt @@ -22,8 +22,9 @@ archive with specified base-name, or to the standard output. A packed archive is an efficient way to transfer set of objects between two repositories, and also is an archival format which is efficient to access. The packed archive format (.pack) is -designed to be unpackable without having anything else, but for -random access, accompanied with the pack index file (.idx). +designed to be self contained so that it can be unpacked without +any further information, but for fast, random access to the objects +in the pack, a pack index file (.idx) will be generated. Placing both in the pack/ subdirectory of $GIT_OBJECT_DIRECTORY (or any of the directories on $GIT_ALTERNATE_OBJECT_DIRECTORIES) From 80dd7b44970dee7d82fa735d2e0b828051f80545 Mon Sep 17 00:00:00 2001 From: Gerrit Pape Date: Wed, 26 Mar 2008 18:45:26 +0000 Subject: [PATCH 07/14] gitk: Fix changing colors through Edit->Preferences With tcl/tk8.5 the lset command seems to behave differently. When changing the background color through Edit->Preferences, the changes are applied, but new dialogs, such as View->New view... barf with Error: unknown color name "{#ffffff}" Additionally when closing gitk, and starting it up again, a bad value has been saved to ~/.gitk, preventing gitk from running properly; it fails with Error in startup script: unknown color name "{#ffffff}" ... This commit fixes the problem by changing the color dialogs to pass the empty string {} as the list index to choosecolor. This causes the lset and lindex commands used by choosecolor to use and set the whole variable (bgcolor, fgcolor or selectbgcolor) rather than treating them as a 1-element list. Tested with tcl/tk8.4 and 8.5. Dmitry Potapov reported this problem through http://bugs.debian.org/472615 Signed-off-by: Gerrit Pape Signed-off-by: Paul Mackerras --- gitk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gitk b/gitk index 84ab02e15f..9a4d9c40cf 100755 --- a/gitk +++ b/gitk @@ -8045,11 +8045,11 @@ proc doprefs {} { grid $top.cdisp - -sticky w -pady 10 label $top.bg -padx 40 -relief sunk -background $bgcolor button $top.bgbut -text [mc "Background"] -font optionfont \ - -command [list choosecolor bgcolor 0 $top.bg background setbg] + -command [list choosecolor bgcolor {} $top.bg background setbg] grid x $top.bgbut $top.bg -sticky w label $top.fg -padx 40 -relief sunk -background $fgcolor button $top.fgbut -text [mc "Foreground"] -font optionfont \ - -command [list choosecolor fgcolor 0 $top.fg foreground setfg] + -command [list choosecolor fgcolor {} $top.fg foreground setfg] grid x $top.fgbut $top.fg -sticky w label $top.diffold -padx 40 -relief sunk -background [lindex $diffcolors 0] button $top.diffoldbut -text [mc "Diff: old lines"] -font optionfont \ @@ -8069,7 +8069,7 @@ proc doprefs {} { grid x $top.hunksepbut $top.hunksep -sticky w label $top.selbgsep -padx 40 -relief sunk -background $selectbgcolor button $top.selbgbut -text [mc "Select bg"] -font optionfont \ - -command [list choosecolor selectbgcolor 0 $top.selbgsep background setselbg] + -command [list choosecolor selectbgcolor {} $top.selbgsep background setselbg] grid x $top.selbgbut $top.selbgsep -sticky w label $top.cfont -text [mc "Fonts: press to choose"] From 9de328fea951eca9524feaa5eb55762467df6b98 Mon Sep 17 00:00:00 2001 From: Peter Eriksen Date: Sun, 6 Apr 2008 22:51:49 +0200 Subject: [PATCH 08/14] Add description of OFS_DELTA to the pack format description Signed-off-by: Peter Eriksen Acked-by: Shawn O. Pearce Signed-off-by: Junio C Hamano --- Documentation/technical/pack-format.txt | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Documentation/technical/pack-format.txt b/Documentation/technical/pack-format.txt index aa87756a55..1803e64e46 100644 --- a/Documentation/technical/pack-format.txt +++ b/Documentation/technical/pack-format.txt @@ -103,10 +103,24 @@ Pack file entry: <+ packed object data: If it is not DELTA, then deflated bytes (the size above is the size before compression). - If it is DELTA, then + If it is REF_DELTA, then 20-byte base object name SHA1 (the size above is the size of the delta data that follows). delta data, deflated. + If it is OFS_DELTA, then + n-byte offset (see below) interpreted as a negative + offset from the type-byte of the header of the + ofs-delta entry (the size above is the size of + the delta data that follows). + delta data, deflated. + + offset encoding: + n bytes with MSB set in all but the last one. + The offset is then the number constructed by + concatenating the lower 7 bit of each byte, and + for n >= 2 adding 2^7 + 2^14 + ... + 2^(7*(n-1)) + to the result. + = Version 2 pack-*.idx files support packs larger than 4 GiB, and From ee5a317e0130ab2db59db97c644576335530512d Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sun, 6 Apr 2008 19:21:45 -0700 Subject: [PATCH 09/14] Fix "git apply" to correctly enforce "match at the beginning" An earlier commit 4be6096 (apply --unidiff-zero: loosen sanity checks for --unidiff=0 patches, 2006-09-17) made match_beginning and match_end computed incorrectly. If a hunk inserts at the beginning, old position recorded at the hunk is line 0, and if a hunk changes at the beginning, it is line 1. The new test added to t4104 exposes that the old code did not insist on matching at the beginning for a patch to add a line to an empty file. An even older 65aadb9 (apply: force matching at the beginning., 2006-05-24) was equally wrong in that it tried to take hints from the number of leading context lines, to decide if the hunk must match at the beginning, but we can just look at the line number in the hunk to decide. Signed-off-by: Junio C Hamano --- builtin-apply.c | 29 ++++++++++++++++------------- t/t4104-apply-boundary.sh | 13 +++++++++++++ 2 files changed, 29 insertions(+), 13 deletions(-) diff --git a/builtin-apply.c b/builtin-apply.c index a11b1bbeee..03f2e950ba 100644 --- a/builtin-apply.c +++ b/builtin-apply.c @@ -1736,21 +1736,24 @@ static int apply_one_fragment(struct strbuf *buf, struct fragment *frag, trailing = frag->trailing; /* - * If we don't have any leading/trailing data in the patch, - * we want it to match at the beginning/end of the file. + * A hunk to change lines at the beginning would begin with + * @@ -1,L +N,M @@ * - * But that would break if the patch is generated with - * --unified=0; sane people wouldn't do that to cause us - * trouble, but we try to please not so sane ones as well. + * And a hunk to add to an empty file would begin with + * @@ -0,0 +N,M @@ + * + * In other words, a hunk that is (frag->oldpos <= 1) with or + * without leading context must match at the beginning. */ - if (unidiff_zero) { - match_beginning = (!leading && !frag->oldpos); - match_end = 0; - } - else { - match_beginning = !leading && (frag->oldpos == 1); - match_end = !trailing; - } + match_beginning = frag->oldpos <= 1; + + /* + * A hunk without trailing lines must match at the end. + * However, we simply cannot tell if a hunk must match end + * from the lack of trailing lines if the patch was generated + * with unidiff without any context. + */ + match_end = !unidiff_zero && !trailing; lines = 0; pos = frag->newpos; diff --git a/t/t4104-apply-boundary.sh b/t/t4104-apply-boundary.sh index 64f34e3298..43943ab8ca 100755 --- a/t/t4104-apply-boundary.sh +++ b/t/t4104-apply-boundary.sh @@ -112,4 +112,17 @@ do ' done +test_expect_success 'two lines' ' + + >file && + git add file && + echo aaa >file && + git diff >patch && + git add file && + echo bbb >file && + git add file && + test_must_fail git apply --check patch + +' + test_done From d9e3b7025fdfeb80bb72a10b5d272acfbb5df72a Mon Sep 17 00:00:00 2001 From: Pascal Obry Date: Sun, 6 Apr 2008 19:32:24 +0200 Subject: [PATCH 10/14] Add interactive option in rebase command completion list. Signed-off-by: Pascal Obry Acked-by: Shawn O. Pearce Signed-off-by: Junio C Hamano --- contrib/completion/git-completion.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 791e30f6d7..96a712b5ea 100755 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -865,7 +865,7 @@ _git_rebase () return ;; --*) - __gitcomp "--onto --merge --strategy" + __gitcomp "--onto --merge --strategy --interactive" return esac __gitcomp "$(__git_refs)" From f2b3e3c722fed852c59880f4773bc51833229cd3 Mon Sep 17 00:00:00 2001 From: Christian Couder Date: Sun, 6 Apr 2008 19:08:50 +0200 Subject: [PATCH 11/14] test suite: remove useless TERM cruft in "t7005-editor.sh" In commit 15387e3 (Test suite: reset TERM to its previous value after testing., 2007-10-26), I added a workaround to reset TERM to its previous value before the "test_done" at the end of "t7005-editor.sh" because otherwise "test_done" would have printed the test result with a bad TERM env variable (this resulted in output with no color on konsole). But since commit c2116a1 (test-lib: fix TERM to dumb for test repeatability, 2008-03-06), colored output is printed in a subshell with TERM reset to its original value so the earlier workaround is not needed anymore. Signed-off-by: Christian Couder Signed-off-by: Junio C Hamano --- t/t7005-editor.sh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/t/t7005-editor.sh b/t/t7005-editor.sh index 6a74b3acfd..2d919d69ef 100755 --- a/t/t7005-editor.sh +++ b/t/t7005-editor.sh @@ -4,8 +4,6 @@ test_description='GIT_EDITOR, core.editor, and stuff' . ./test-lib.sh -OLD_TERM="$TERM" - for i in GIT_EDITOR core_editor EDITOR VISUAL vi do cat >e-$i.sh <<-EOF @@ -116,6 +114,4 @@ test_expect_success 'core.editor with a space' ' ' -TERM="$OLD_TERM" - test_done From aba201c6e8d9934157b9ba39b8e6b54c2fa7b6e1 Mon Sep 17 00:00:00 2001 From: Pascal Obry Date: Sun, 6 Apr 2008 18:56:08 +0200 Subject: [PATCH 12/14] Add prefix oriented completions for diff and format-patch commands. Signed-off-by: Pascal Obry Acked-by: Shawn O. Pearce Signed-off-by: Junio C Hamano --- contrib/completion/git-completion.bash | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 96a712b5ea..4d81963b1d 100755 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -639,7 +639,9 @@ _git_diff () --find-copies-harder --pickaxe-all --pickaxe-regex --text --ignore-space-at-eol --ignore-space-change --ignore-all-space --exit-code --quiet --ext-diff - --no-ext-diff" + --no-ext-diff + --no-prefix --src-prefix= --dst-prefix= + " return ;; esac @@ -696,6 +698,7 @@ _git_format_patch () --full-index --binary --not --all --cover-letter + --no-prefix --src-prefix= --dst-prefix= " return ;; From f61cc48d289755065813db1fbbd18e6bb0836076 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 7 Apr 2008 00:08:03 -0700 Subject: [PATCH 13/14] git-svn: fix following renamed paths when tracking a single path When using git-svn to follow only a single (empty) path per svn-remote (i.e. not using --stdlayout), following the history of a renamed path was broken in c586879cdfa4f8181a14e953a9152a4639eef333. This reverts the regression for the single (emtpy) path per svn-remote case. To avoid breaking the tests in a committed revision, this is an addendum to a patch originally submitted by Santhosh Kumar Mani : > git-svn: add test for renamed directory fetch > > This test tries to fetch a directory which had renames in the > history from a SVN repository. [ew: unneccesary dependency on the starting an HTTP server removed from Santhosh's original test.] Signed-off-by: Eric Wong Signed-off-by: Junio C Hamano --- git-svn.perl | 5 +- t/t9121-git-svn-fetch-renamed-dir.sh | 20 +++++++ t/t9121/renamed-dir.dump | 90 ++++++++++++++++++++++++++++ 3 files changed, 113 insertions(+), 2 deletions(-) create mode 100755 t/t9121-git-svn-fetch-renamed-dir.sh create mode 100644 t/t9121/renamed-dir.dump diff --git a/git-svn.perl b/git-svn.perl index 1b44cbe106..81afb5cfcd 100755 --- a/git-svn.perl +++ b/git-svn.perl @@ -2239,12 +2239,13 @@ sub find_parent_branch { # just grow a tail if we're not unique enough :x $ref_id .= '-' while find_ref($ref_id); print STDERR "Initializing parent: $ref_id\n"; - my ($u, $p) = ($new_url, ''); + my ($u, $p, $repo_id) = ($new_url, '', $ref_id); if ($u =~ s#^\Q$url\E(/|$)##) { $p = $u; $u = $url; + $repo_id = $self->{repo_id}; } - $gs = Git::SVN->init($u, $p, $self->{repo_id}, $ref_id, 1); + $gs = Git::SVN->init($u, $p, $repo_id, $ref_id, 1); } my ($r0, $parent) = $gs->find_rev_before($r, 1); if (!defined $r0 || !defined $parent) { diff --git a/t/t9121-git-svn-fetch-renamed-dir.sh b/t/t9121-git-svn-fetch-renamed-dir.sh new file mode 100755 index 0000000000..5143ed6066 --- /dev/null +++ b/t/t9121-git-svn-fetch-renamed-dir.sh @@ -0,0 +1,20 @@ +#!/bin/sh +# +# Copyright (c) 2008 Santhosh Kumar Mani + + +test_description='git-svn can fetch renamed directories' + +. ./lib-git-svn.sh + +test_expect_success 'load repository with renamed directory' " + svnadmin load -q $rawsvnrepo < ../t9121/renamed-dir.dump + " + +test_expect_success 'init and fetch repository' " + git svn init $svnrepo/newname && + git svn fetch + " + +test_done + diff --git a/t/t9121/renamed-dir.dump b/t/t9121/renamed-dir.dump new file mode 100644 index 0000000000..5f9127be92 --- /dev/null +++ b/t/t9121/renamed-dir.dump @@ -0,0 +1,90 @@ +SVN-fs-dump-format-version: 2 + +UUID: 06b9b3ad-f546-4fbe-8328-fcb4e6ef5c3f + +Revision-number: 0 +Prop-content-length: 56 +Content-length: 56 + +K 8 +svn:date +V 27 +2008-04-02T09:11:59.778557Z +PROPS-END + +Revision-number: 1 +Prop-content-length: 117 +Content-length: 117 + +K 7 +svn:log +V 14 +initial import +K 10 +svn:author +V 8 +santhosh +K 8 +svn:date +V 27 +2008-04-02T09:13:03.170863Z +PROPS-END + +Node-path: name +Node-kind: dir +Node-action: add +Prop-content-length: 10 +Content-length: 10 + +PROPS-END + + +Node-path: name/a.txt +Node-kind: file +Node-action: add +Prop-content-length: 71 +Text-content-length: 6 +Text-content-md5: b1946ac92492d2347c6235b4d2611184 +Content-length: 77 + +K 13 +svn:mime-type +V 10 +text/plain +K 13 +svn:eol-style +V 2 +LF +PROPS-END +hello + + +Revision-number: 2 +Prop-content-length: 109 +Content-length: 109 + +K 7 +svn:log +V 7 +renamed +K 10 +svn:author +V 8 +santhosh +K 8 +svn:date +V 27 +2008-04-02T09:14:22.952186Z +PROPS-END + +Node-path: newname +Node-kind: dir +Node-action: add +Node-copyfrom-rev: 1 +Node-copyfrom-path: name + + +Node-path: name +Node-action: delete + + From 1d2375ddfee18bd3effd2c1f98527cc2f8b1df0a Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Mon, 7 Apr 2008 21:57:43 -0700 Subject: [PATCH 14/14] GIT 1.5.5 Signed-off-by: Junio C Hamano --- Documentation/RelNotes-1.5.5.txt | 8 +------- Documentation/git.txt | 5 +++++ GIT-VERSION-GEN | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/Documentation/RelNotes-1.5.5.txt b/Documentation/RelNotes-1.5.5.txt index 64a52afb9d..2932212488 100644 --- a/Documentation/RelNotes-1.5.5.txt +++ b/Documentation/RelNotes-1.5.5.txt @@ -6,7 +6,7 @@ Updates since v1.5.4 (subsystems) - * Comes with git-gui 0.10.0 + * Comes with git-gui 0.10.1 (portability) @@ -205,9 +205,3 @@ this release, unless otherwise noted. * "git imap-send" without setting imap.host did not error out but segfaulted. - ---- -exec >/var/tmp/1 -O=v1.5.5-rc3 -echo O=`git describe refs/heads/master` -git shortlog --no-merges $O..refs/heads/master ^refs/heads/maint diff --git a/Documentation/git.txt b/Documentation/git.txt index aaf3189936..336fe99cc7 100644 --- a/Documentation/git.txt +++ b/Documentation/git.txt @@ -43,6 +43,11 @@ unreleased) version of git, that is available from 'master' branch of the `git.git` repository. Documentation for older releases are available here: +* link:v1.5.5/git.html[documentation for release 1.5.5] + +* release notes for + link:RelNotes-1.5.5.txt[1.5.5]. + * link:v1.5.4.5/git.html[documentation for release 1.5.4.5] * release notes for diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN index 565cb41c10..f60bab896b 100755 --- a/GIT-VERSION-GEN +++ b/GIT-VERSION-GEN @@ -1,7 +1,7 @@ #!/bin/sh GVF=GIT-VERSION-FILE -DEF_VER=v1.5.5-rc3.GIT +DEF_VER=v1.5.5.GIT LF=' '