summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* tag: add the option to force signing of annotated tagsla/tag-force-signing-annotated-tagsLaurent Arnoud2016-03-223-6/+60
| | | | | | | | | | | | | | | | | | | | | | | | | The `tag.forcesignannotated` configuration variable makes "git tag" that would implicitly create an annotated tag to instead create a signed tag. For example $ git tag -m "This is a message" tag-with-message $ git tag -F message-file tag-with-message would create a signed tag if the configuration variable is in effect. To override this from the command line, the user can explicitly ask for an annotated tag, like so: $ git tag -a -m "This is a message" tag-with-message $ git tag -a -F message-file tag-with-message Creation of a light-weight tag, i.e. $ git tag lightweight is not affected. Signed-off-by: Laurent Arnoud <laurent@spkdev.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Git 2.8-rc4v2.8.0-rc4Junio C Hamano2016-03-211-1/+1
| | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Sync with maintJunio C Hamano2016-03-212-3/+3
|\ | | | | | | | | | | * maint: Documentation: fix broken linkgit to git-config git-compat-util: st_add4: work around gcc 4.2.x compiler crash
| * Merge branch 'mm/doc-hooks-linkgit-fix' into maintJunio C Hamano2016-03-211-1/+1
| |\ | | | | | | | | | | | | * mm/doc-hooks-linkgit-fix: Documentation: fix broken linkgit to git-config
| | * Documentation: fix broken linkgit to git-configmm/doc-hooks-linkgit-fixMatthieu Moy2016-03-211-1/+1
| | | | | | | | | | | | | | | Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | Merge branch 'es/st-add4-gcc-4.2-workaround' into maintJunio C Hamano2016-03-211-2/+2
| |\ \ | | | | | | | | | | | | | | | | * es/st-add4-gcc-4.2-workaround: git-compat-util: st_add4: work around gcc 4.2.x compiler crash
| | * | git-compat-util: st_add4: work around gcc 4.2.x compiler crashes/st-add4-gcc-4.2-workaroundEric Sunshine2016-03-211-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Although changes by 5b442c4 (tree-diff: catch integer overflow in combine_diff_path allocation, 2016-02-19) are perfectly valid, they unfortunately trigger an internal compiler error in gcc 4.2.x: combine-diff.c: In function 'diff_tree_combined': combine-diff.c:1391: internal compiler error: Segmentation fault: 11 Experimentation reveals that changing st_add4()'s argument evaluation order is sufficient to sidestep this problem. Although st_add3() does not trigger the compiler bug, for style consistency, change its argument evaluation order to match. Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | Merge branch 'tb/avoid-gcc-on-darwin-10-6'Junio C Hamano2016-03-211-3/+0
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | * tb/avoid-gcc-on-darwin-10-6: Revert "config.mak.uname: use clang for Mac OS X 10.6"
| * | | | Revert "config.mak.uname: use clang for Mac OS X 10.6"tb/avoid-gcc-on-darwin-10-6Eric Sunshine2016-03-211-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 7b6daf8d2fee1a9866b1d4eddbfaa5dbc42c5dbb. Now that st_add4() has been patched to work around the gcc 4.2.x compiler crash, revert the sledge-hammer approach of forcing Mac OS X 10.6 to unconditionally use 'clang' rather than the default compiler (gcc). Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | Merge tag 'l10n-2.8.0-rnd3' of git://github.com/git-l10n/git-poJunio C Hamano2016-03-206-82/+283
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | l10n-2.8.0-rnd3 * tag 'l10n-2.8.0-rnd3' of git://github.com/git-l10n/git-po: l10n: zh_CN: review for git v2.8.0 l10n round 2 l10n: de.po: add missing newlines l10n: de.po: translate 22 new messages l10n: ko.po: Update Korean translation l10n: fr.po v2.8.0 round 3 l10n: sv.po: Update Swedish translation (2530t0f0u) l10n: ru.po: update Russian translation
| * | | | | l10n: zh_CN: review for git v2.8.0 l10n round 2Ray Chen2016-03-201-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Ray Chen <oldsharp@gmail.com>
| * | | | | l10n: de.po: add missing newlinesRalf Thielow2016-03-171-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
| * | | | | l10n: de.po: translate 22 new messagesRalf Thielow2016-03-171-37/+136
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Translate 22 new messages came from git.pot update in f1522b2 (l10n: git.pot: v2.8.0 round 2 (21 new, 1 removed)) and a5a4168 (l10n: git.pot: Add one new message for Git 2.8.0). Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com> Acked-by: Matthias Rüster <matthias.ruester@gmail.com>
| * | | | | Merge branch 'fr_v2.8.0_r3' of git://github.com/jnavila/gitJiang Xin2016-03-171-5/+7
| |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 'fr_v2.8.0_r3' of git://github.com/jnavila/git: l10n: fr.po v2.8.0 round 3
| | * | | | | l10n: fr.po v2.8.0 round 3Jean-Noel Avila2016-03-151-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Jean-Noel Avila <jn.avila@free.fr>
| * | | | | | Merge branch 'ko/merge-l10n' of https://github.com/changwoo/git-l10n-koJiang Xin2016-03-171-3/+7
| |\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 'ko/merge-l10n' of https://github.com/changwoo/git-l10n-ko: l10n: ko.po: Update Korean translation
| | * | | | | | l10n: ko.po: Update Korean translationChangwoo Ryu2016-03-161-3/+7
| | |/ / / / / | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Changwoo Ryu <cwryu@debian.org>
| * | | | | | Merge branch 'master' of git://github.com/nafmo/git-l10n-svJiang Xin2016-03-171-31/+122
| |\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 'master' of git://github.com/nafmo/git-l10n-sv: l10n: sv.po: Update Swedish translation (2530t0f0u)
| | * | | | | | l10n: sv.po: Update Swedish translation (2530t0f0u)Peter Krefting2016-03-151-31/+122
| | |/ / / / / | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Peter Krefting <peter@softwolves.pp.se>
| * | | | | | l10n: ru.po: update Russian translationDimitriy Ryazantcev2016-03-151-2/+6
| |/ / / / / | | | | | | | | | | | | | | | | | | Signed-off-by: Dimitriy Ryazantcev <dimitriy.ryazantcev@gmail.com>
* | | | | | Merge branch 'master' of git://ozlabs.org/~paulus/gitkJunio C Hamano2016-03-204-804/+788
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 'master' of git://ozlabs.org/~paulus/gitk: gitk: Follow themed bgcolor in help dialogs gitk: fr.po: Sync translations with git gitk: Update French translation (311t) gitk: Update German translation gitk: Update Bulgarian translation (311t)
| * | | | | | gitk: Follow themed bgcolor in help dialogsGuillermo S. Romero2016-03-191-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make Help > About & Key bindings dialogs readable if theme has changed font color to something incompatible with white. Signed-off-by: Guillermo S. Romero <gsromero@infernal-iceberg.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
| * | | | | | gitk: fr.po: Sync translations with gitJean-Noel Avila2016-03-191-50/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Jean-Noel Avila <jn.avila@free.fr> Signed-off-by: Paul Mackerras <paulus@samba.org>
| * | | | | | gitk: Update French translation (311t)Jean-Noel Avila2016-03-191-388/+373
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Jean-Noel Avila <jn.avila@free.fr> Signed-off-by: Paul Mackerras <paulus@samba.org>
| * | | | | | gitk: Update German translationRalf Thielow2016-03-191-46/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
| * | | | | | gitk: Update Bulgarian translation (311t)Alexander Shopov2016-03-191-320/+336
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Alexander Shopov <ash@kambanaria.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
* | | | | | | RelNotes: remove the mention of !reinclusionJunio C Hamano2016-03-181-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We will be postponing this to a later cycle. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | Revert "Merge branch 'nd/exclusion-regression-fix'"Junio C Hamano2016-03-187-378/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 5e57f9c3dfe7dd44a1b56bb5b3327d7a1356ec7c, reversing changes made to e79112d21024beb997951381db21a70b087d459d. We will be postponing nd/exclusion-regression-fix topic to later cycle.
* | | | | | | Revert "Merge branch 'jc/exclusion-doc'"Junio C Hamano2016-03-181-37/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit e80aae51f2be908e37fca47ea0dff6d7861c8497, reversing changes made to 68846a92eafa6b2bfae778d0a656443a9fa61e59. We will be postponing nd/exclusion-regression-fix topic to later cycle.
* | | | | | | Sync with Git 2.7.4Junio C Hamano2016-03-175-3/+50
|\ \ \ \ \ \ \ | | |_|_|/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * maint: Git 2.7.4 Git 2.6.6 Git 2.5.5 Git 2.4.11
| * | | | | | Git 2.7.4v2.7.4Junio C Hamano2016-03-173-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | Sync with Git 2.6.6Junio C Hamano2016-03-174-3/+39
| |\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * maint-2.6: Git 2.6.6 Git 2.5.5 Git 2.4.11
| | * | | | | | Git 2.6.6v2.6.6Junio C Hamano2016-03-174-3/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
| | * | | | | | Merge branch 'maint-2.5' into maint-2.6Junio C Hamano2016-03-1716-148/+110
| | |\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * maint-2.5: Git 2.5.5 Git 2.4.11 list-objects: pass full pathname to callbacks list-objects: drop name_path entirely list-objects: convert name_path to a strbuf show_object_with_name: simplify by using path_name() http-push: stop using name_path tree-diff: catch integer overflow in combine_diff_path allocation add helpers for detecting size_t overflow
| | | * | | | | | Git 2.5.5v2.5.5Junio C Hamano2016-03-174-3/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
| | | * | | | | | Merge branch 'maint-2.4' into maint-2.5Junio C Hamano2016-03-1715-147/+97
| | | |\ \ \ \ \ \ | | | | | |_|_|_|/ | | | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * maint-2.4: Git 2.4.11 list-objects: pass full pathname to callbacks list-objects: drop name_path entirely list-objects: convert name_path to a strbuf show_object_with_name: simplify by using path_name() http-push: stop using name_path tree-diff: catch integer overflow in combine_diff_path allocation add helpers for detecting size_t overflow
| | | | * | | | | Git 2.4.11v2.4.11Junio C Hamano2016-03-174-3/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
| | | | * | | | | Merge branch 'jk/path-name-safety-2.4' into maint-2.4Junio C Hamano2016-03-1713-146/+84
| | | | |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bugfix patches were backported from the 'master' front to plug heap corruption holes, to catch integer overflow in the computation of pathname lengths, and to get rid of the name_path API. Both of these would have resulted in writing over an under-allocated buffer when formulating pathnames while tree traversal. * jk/path-name-safety-2.4: list-objects: pass full pathname to callbacks list-objects: drop name_path entirely list-objects: convert name_path to a strbuf show_object_with_name: simplify by using path_name() http-push: stop using name_path tree-diff: catch integer overflow in combine_diff_path allocation add helpers for detecting size_t overflow
* | | | | | | | | | Git 2.8-rc3v2.8.0-rc3Junio C Hamano2016-03-162-1/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | | | | Merge branch 'master' of git://bogomips.org/git-svnJunio C Hamano2016-03-162-6/+14
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 'master' of git://bogomips.org/git-svn: git-svn: fix URL canonicalization during init w/ SVN 1.7+ t9117: test specifying full url to git svn init -T
| * | | | | | | | | | git-svn: fix URL canonicalization during init w/ SVN 1.7+Eric Wong2016-03-162-7/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | URL canonicalization when full URLs are passed became broken when using SVN::_Core::svn_dirent_canonicalize under SVN 1.7. Ensure we canonicalize paths and URLs with appropriate functions for each type from now on as the path/URL-agnostic SVN::_Core::svn_path_canonicalize function is deprecated in SVN. Tested with the following commands: git svn init -T svn://svn.code.sf.net/p/squirrelmail/code/trunk git svn init -b svn://svn.code.sf.net/p/squirrelmail/code/branches Reported-by: Adam Dinwoodie <adam@dinwoodie.org> http://mid.gmane.org/20160315162344.GM29016@dinwoodie.org Signed-off-by: Eric Wong <normalperson@yhbt.net>
| * | | | | | | | | | t9117: test specifying full url to git svn init -TAdam Dinwoodie2016-03-161-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to the documentation, full URLs can be specified in the `-T` argument to `git svn init`. However, the canonicalization of such arguments squashes together consecutive "/"s, which unsurprisingly breaks http://, svn://, etc URLs. Add a failing test case to provide evidence of that. On systems where Subversion provides svn_path_canonicalize but not svn_dirent_canonicalize (Subversion 1.6 and earlier?), this test passes, as svn_path_canonicalize doesn't mangle the consecutive "/"s. [ew: fixed whitespace] Signed-off-by: Adam Dinwoodie <adam@dinwoodie.org> Signed-off-by: Eric Wong <normalperson@yhbt.net>
* | | | | | | | | | | Sync with maintJunio C Hamano2016-03-160-0/+0
|\ \ \ \ \ \ \ \ \ \ \ | | |/ / / / / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * maint: list-objects: pass full pathname to callbacks list-objects: drop name_path entirely list-objects: convert name_path to a strbuf show_object_with_name: simplify by using path_name() http-push: stop using name_path tree-diff: catch integer overflow in combine_diff_path allocation add helpers for detecting size_t overflow
| * | | | | | | | | | Merge branch 'jk/path-name-safety-2.7' into maintJunio C Hamano2016-03-1610-142/+46
| |\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * jk/path-name-safety-2.7: list-objects: pass full pathname to callbacks list-objects: drop name_path entirely list-objects: convert name_path to a strbuf show_object_with_name: simplify by using path_name() http-push: stop using name_path tree-diff: catch integer overflow in combine_diff_path allocation add helpers for detecting size_t overflow
| | * \ \ \ \ \ \ \ \ \ Merge branch 'jk/path-name-safety-2.6' into jk/path-name-safety-2.7jk/path-name-safety-2.7Junio C Hamano2016-03-1610-142/+46
| | |\ \ \ \ \ \ \ \ \ \ | |/ / / / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * jk/path-name-safety-2.6: list-objects: pass full pathname to callbacks list-objects: drop name_path entirely list-objects: convert name_path to a strbuf show_object_with_name: simplify by using path_name() http-push: stop using name_path tree-diff: catch integer overflow in combine_diff_path allocation add helpers for detecting size_t overflow
| | * | | | | | | | | | Merge branch 'jk/path-name-safety-2.5' into jk/path-name-safety-2.6jk/path-name-safety-2.6Junio C Hamano2016-03-1613-146/+84
| | |\ \ \ \ \ \ \ \ \ \ | | | |_|/ / / / / / / / | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * jk/path-name-safety-2.5: list-objects: pass full pathname to callbacks list-objects: drop name_path entirely list-objects: convert name_path to a strbuf show_object_with_name: simplify by using path_name() http-push: stop using name_path tree-diff: catch integer overflow in combine_diff_path allocation add helpers for detecting size_t overflow
| | | * | | | | | | | | Merge branch 'jk/path-name-safety-2.4' into jk/path-name-safety-2.5jk/path-name-safety-2.5Junio C Hamano2016-03-1613-146/+84
| | | |\ \ \ \ \ \ \ \ \ | | | | |_|/ / / / / / / | | | |/| | | / / / / / | | | | | |_|/ / / / / | | | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * jk/path-name-safety-2.4: list-objects: pass full pathname to callbacks list-objects: drop name_path entirely list-objects: convert name_path to a strbuf show_object_with_name: simplify by using path_name() http-push: stop using name_path tree-diff: catch integer overflow in combine_diff_path allocation add helpers for detecting size_t overflow
| | | | * | | | | | | list-objects: pass full pathname to callbacksjk/path-name-safety-2.4Jeff King2016-03-169-58/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we find a blob at "a/b/c", we currently pass this to our show_object_fn callbacks as two components: "a/b/" and "c". Callbacks which want the full value then call path_name(), which concatenates the two. But this is an inefficient interface; the path is a strbuf, and we could simply append "c" to it temporarily, then roll back the length, without creating a new copy. So we could improve this by teaching the callsites of path_name() this trick (and there are only 3). But we can also notice that no callback actually cares about the broken-down representation, and simply pass each callback the full path "a/b/c" as a string. The callback code becomes even simpler, then, as we do not have to worry about freeing an allocated buffer, nor rolling back our modification to the strbuf. This is theoretically less efficient, as some callbacks would not bother to format the final path component. But in practice this is not measurable. Since we use the same strbuf over and over, our work to grow it is amortized, and we really only pay to memcpy a few bytes. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| | | | * | | | | | | list-objects: drop name_path entirelyJeff King2016-03-169-25/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the previous commit, we left name_path as a thin wrapper around a strbuf. This patch drops it entirely. As a result, every show_object_fn callback needs to be adjusted. However, none of their code needs to be changed at all, because the only use was to pass it to path_name(), which now handles the bare strbuf. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| | | | * | | | | | | list-objects: convert name_path to a strbufJeff King2016-03-163-36/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The "struct name_path" data is examined in only two places: we generate it in process_tree(), and we convert it to a single string in path_name(). Everyone else just passes it through to those functions. We can further note that process_tree() already keeps a single strbuf with the leading tree path, for use with tree_entry_interesting(). Instead of building a separate name_path linked list, let's just use the one we already build in "base". This reduces the amount of code (especially tricky code in path_name() which did not check for integer overflows caused by deep or large pathnames). It is also more efficient in some instances. Any time we were using tree_entry_interesting, we were building up the strbuf anyway, so this is an immediate and obvious win there. In cases where we were not, we trade off storing "pathname/" in a strbuf on the heap for each level of the path, instead of two pointers and an int on the stack (with one pointer into the tree object). On a 64-bit system, the latter is 20 bytes; so if path components are less than that on average, this has lower peak memory usage. In practice it probably doesn't matter either way; we are already holding in memory all of the tree objects leading up to each pathname, and for normal-depth pathnames, we are only talking about hundreds of bytes. This patch leaves "struct name_path" as a thin wrapper around the strbuf, to avoid disrupting callbacks. We should fix them, but leaving it out makes this diff easier to view. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>