summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2011-10-31gitweb: Add navigation to select side-by-side diffLibravatar Kato Kazuyoshi1-0/+23
Add to the lower part of navigation bar (the action specific part) links allowing to switch between 'inline' (ordinary) diff and 'side by side' style diff. It is not shown for combined / compact combined diff. Signed-off-by: Kato Kazuyoshi <kato.kazuyoshi@gmail.com> Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-31gitweb: Use href(-replay=>1,...) for formats links in "commitdiff"Libravatar Jakub Narebski1-8/+8
Use href(-replay->1,...) in (sub)navigation links (like changing style of view, or going to parent commit) so that extra options are preserved. This is needed so clicking on such (sub)navigation link would preserve style of diff; for example when using "side-by-side" diff style then going to parent commit would now also use this style. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-31t9500: Add basic sanity tests for side-by-side diff in gitwebLibravatar Jakub Narebski1-1/+25
Test that side-by-side diff can deal with incomplete lines (and while at it with pure addition, pure removal, and change), and with merge commits, producing no errors or warnings. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-31t9500: Add test for handling incomplete lines in diff by gitwebLibravatar Jakub Narebski1-0/+47
Check that "commitdiff" action in gitweb can handle (without errors) incomplete lines as added and removed lines, and as context lines. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-31gitweb: Give side-by-side diff extra CSS stylingLibravatar Jakub Narebski2-10/+42
Use separate background colors for pure removal, pure addition and change for side-by-side diff. This makes reading such diff easier, allowing to easily distinguish empty lines in diff from vertical whitespace used to align chunk blocks. Note that if lines in diff were numbered, the absence of line numbers [for one side] would help in distinguishing empty lines from vertical align. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-31gitweb: Add a feature to show side-by-side diffLibravatar Kato Kazuyoshi2-11/+122
This commits adds to support for showing "side-by-side" style diff. Currently you have to hand-craft the URL; navigation for selecting diff style is to be added in the next commit. The diff output in unified format from "git diff-tree" is reorganized to side-by-side style chunk by chunk with format_sidebyside_diff_chunk(). This reorganization requires knowledge about diff line classification, so format_diff_line() was renamed to process_diff_line(), and changed to return tuple (list) consisting of class of diff line and of HTML-formatted (but not wrapped in <div class="diff ...">...</div>) diff line. Wrapping is now done by caller, i.e. git_patchset_body(). Gitweb uses float+margin CSS-based layout for "side by side" diff. You can specify style of diff with "ds" ('diff_style') query parameter. Currently supported values are 'inline' and 'sidebyside'; the default is 'inline'. Another solution would be to use "opt" ('extra_options') for that... though current use of it in gitweb seems to suggest that "opt" is more about passing extra options to underlying git commands, and "git diff" doesn't support '--side-by-side' like GNU diff does, (yet?). Signed-off-by: Kato Kazuyoshi <kato.kazuyoshi@gmail.com> Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-31gitweb: Extract formatting of diff chunk headerLibravatar Jakub Narebski1-47/+67
Refactor main parts of HTML-formatting for diff chunk headers (formatting means here adding links and syntax hightlighting) into separate subroutines: * format_unidiff_chunk_header for ordinary diff, * format_cc_diff_chunk_header for combined diff (more than one parent) This makes format_diff_line() subroutine easier to follow. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-31gitweb: Refactor diff body line classificationLibravatar Jakub Narebski1-30/+37
Simplify classification of diff line body in format_diff_line(), replacing two long if-elsif chains (one for ordinary diff and one for combined diff of a merge commit) with a single regexp match. Refactor this code into diff_line_class() function. While at it: * Fix an artifact in that $diff_class included leading space to be able to compose classes like this "class=\"diff$diff_class\"', even when $diff_class was an empty string. This made code unnecessary ugly: $diff_class is now just class name or an empty string. * Introduce "ctx" class for context lines ($diff_class was set to "" in this case before this commit). Idea and initial code by Junio C Hamano, polish and testing by Jakub Narebski. Inspired by patch adding side-by-side diff by Kato Kazuyoshi, which required $diff_class to be name of class without extra space. Signed-off-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-30Git 1.7.8-rc0Libravatar Junio C Hamano2-2/+2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-30Merge branch 'jk/git-tricks'Libravatar Junio C Hamano5-0/+355
* jk/git-tricks: completion: match ctags symbol names in grep patterns contrib: add git-jump script contrib: add diff highlight script
2011-10-27Update draft release notes to 1.7.8Libravatar Junio C Hamano1-3/+1
Getting very close to -rc0 Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-27Merge branch 'sn/complete-bash-wo-process-subst'Libravatar Junio C Hamano1-1/+2
* sn/complete-bash-wo-process-subst: completion: fix issue with process substitution not working on Git for Windows
2011-10-27Merge branch 'rj/gitweb-clean-js'Libravatar Junio C Hamano1-1/+3
* rj/gitweb-clean-js: gitweb/Makefile: Remove static/gitweb.js in the clean target
2011-10-27Merge branch 'js/grep-mutex'Libravatar Junio C Hamano1-11/+26
* js/grep-mutex: builtin/grep: simplify lock_and_read_sha1_file() builtin/grep: make lock/unlock into static inline functions git grep: be careful to use mutexes only when they are initialized
2011-10-27Merge branch 'maint'Libravatar Junio C Hamano3-5/+55
* maint: clone: Quote user supplied path in a single quote pair read-cache.c: fix index memory allocation
2011-10-27Merge branch 'rs/maint-estimate-cache-size' into maintLibravatar Junio C Hamano2-3/+53
* rs/maint-estimate-cache-size: read-cache.c: fix index memory allocation
2011-10-27clone: Quote user supplied path in a single quote pairLibravatar Richard Hartmann1-2/+2
Without this patch, $ git clone foo . results in this: Cloning into .... done. With it: Cloning into '.'... done. Signed-off-by: Richard Hartmann <richih.mailinglist@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-26Merge branch 'maint'Libravatar Junio C Hamano1-2/+6
* maint: make the sample pre-commit hook script reject names with newlines, too
2011-10-26Update draft release notes to 1.7.8Libravatar Junio C Hamano1-1/+17
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-26Merge branch 'tc/submodule-clone-name-detection'Libravatar Junio C Hamano1-4/+4
* tc/submodule-clone-name-detection: submodule::module_clone(): silence die() message from module_name() submodule: whitespace fix
2011-10-26Merge branch 'lh/gitweb-site-html-head'Libravatar Junio C Hamano5-0/+17
* lh/gitweb-site-html-head: gitweb: provide a way to customize html headers
2011-10-26Merge branch 'mm/mediawiki-author-fix'Libravatar Junio C Hamano1-0/+4
* mm/mediawiki-author-fix: git-remote-mediawiki: don't include HTTP login/password in author
2011-10-26Merge branch 'jn/libperl-git-config'Libravatar Junio C Hamano3-65/+33
* jn/libperl-git-config: Add simple test for Git::config_path() in t/t9700-perl-git.sh libperl-git: refactor Git::config_*
2011-10-26Merge branch 'jm/maint-gitweb-filter-forks-fix'Libravatar Junio C Hamano1-1/+1
* jm/maint-gitweb-filter-forks-fix: gitweb: fix regression when filtering out forks
2011-10-26Merge branch 'cn/fetch-prune'Libravatar Junio C Hamano5-55/+137
* cn/fetch-prune: fetch: treat --tags like refs/tags/*:refs/tags/* when pruning fetch: honor the user-provided refspecs when pruning refs remote: separate out the remote_find_tracking logic into query_refspecs t5510: add tests for fetch --prune fetch: free all the additional refspecs Conflicts: remote.c
2011-10-26Merge branch 'jn/gitweb-highlite-sanitise' into maintLibravatar Junio C Hamano1-1/+13
* jn/gitweb-highlite-sanitise: gitweb: Strip non-printable characters from syntax highlighter output
2011-10-26Merge branch 'jk/argv-array' into maintLibravatar Junio C Hamano11-107/+261
* jk/argv-array: run_hook: use argv_array API checkout: use argv_array API bisect: use argv_array API quote: provide sq_dequote_to_argv_array refactor argv_array into generic code quote.h: fix bogus comment add sha1_array API docs
2011-10-26Merge branch 'jc/run-receive-hook-cleanup' into maintLibravatar Junio C Hamano1-19/+52
* jc/run-receive-hook-cleanup: refactor run_receive_hook()
2011-10-26Merge branch 'cn/eradicate-working-copy' into maintLibravatar Junio C Hamano4-6/+6
* cn/eradicate-working-copy: Remove 'working copy' from the documentation and C code
2011-10-26Merge branch 'maint-1.7.6' into maintLibravatar Junio C Hamano10-93/+166
* maint-1.7.6: notes_merge_commit(): do not pass temporary buffer to other function gitweb: Fix links to lines in blobs when javascript-actions are enabled mergetool: no longer need to save standard input mergetool: Use args as pathspec to unmerged files t9159-*.sh: skip for mergeinfo test for svn <= 1.4 date.c: Support iso8601 timezone formats remote: only update remote-tracking branch if updating refspec remote rename: warn when refspec was not updated remote: "rename o foo" should not rename ref "origin/bar" remote: write correct fetch spec when renaming remote 'remote'
2011-10-26Merge branch 'mh/maint-notes-merge-pathbuf-fix' into maint-1.7.6Libravatar Junio C Hamano1-1/+2
* mh/maint-notes-merge-pathbuf-fix: notes_merge_commit(): do not pass temporary buffer to other function
2011-10-26Merge branch 'ps/gitweb-js-with-lineno' into maint-1.7.6Libravatar Junio C Hamano1-4/+4
* ps/gitweb-js-with-lineno: gitweb: Fix links to lines in blobs when javascript-actions are enabled
2011-10-26Merge branch 'jm/mergetool-pathspec' into maint-1.7.6Libravatar Junio C Hamano3-70/+71
* jm/mergetool-pathspec: mergetool: no longer need to save standard input mergetool: Use args as pathspec to unmerged files
2011-10-26Merge branch 'mz/remote-rename' into maint-1.7.6Libravatar Junio C Hamano2-7/+52
* mz/remote-rename: remote: only update remote-tracking branch if updating refspec remote rename: warn when refspec was not updated remote: "rename o foo" should not rename ref "origin/bar" remote: write correct fetch spec when renaming remote 'remote'
2011-10-26Merge branch 'rj/maint-t9159-svn-rev-notation' into maint-1.7.6Libravatar Junio C Hamano1-0/+8
* rj/maint-t9159-svn-rev-notation: t9159-*.sh: skip for mergeinfo test for svn <= 1.4
2011-10-26Merge branch 'hl/iso8601-more-zone-formats' into maint-1.7.6Libravatar Junio C Hamano2-11/+29
* hl/iso8601-more-zone-formats: date.c: Support iso8601 timezone formats
2011-10-26Merge branch 'maint-1.7.6' into maintLibravatar Junio C Hamano7-32/+46
* maint-1.7.6: make the sample pre-commit hook script reject names with newlines, too git-read-tree.txt: update sparse checkout examples git-read-tree.txt: correct sparse-checkout and skip-worktree description git-read-tree.txt: language and typography fixes unpack-trees: print "Aborting" to stderr Documentation/git-update-index: refer to 'ls-files' Documentation: basic configuration of notes.rewriteRef
2011-10-26Merge branch 'tr/doc-note-rewrite' into maint-1.7.6Libravatar Junio C Hamano1-1/+2
* tr/doc-note-rewrite: Documentation: basic configuration of notes.rewriteRef
2011-10-26Merge branch 'nd/sparse-doc' into maint-1.7.6Libravatar Junio C Hamano1-2/+2
* nd/sparse-doc: git-read-tree.txt: update sparse checkout examples
2011-10-26Merge branch 'mg/maint-doc-sparse-checkout' into maint-1.7.6Libravatar Junio C Hamano4-25/+31
* mg/maint-doc-sparse-checkout: git-read-tree.txt: correct sparse-checkout and skip-worktree description git-read-tree.txt: language and typography fixes unpack-trees: print "Aborting" to stderr
2011-10-26Merge branch 'maint-1.7.5' into maint-1.7.6Libravatar Junio C Hamano3-5/+12
* maint-1.7.5: make the sample pre-commit hook script reject names with newlines, too Reindent closing bracket using tab instead of spaces Documentation/git-update-index: refer to 'ls-files'
2011-10-26Merge branch 'maint-1.7.4' into maint-1.7.5Libravatar Junio C Hamano3-5/+12
* maint-1.7.4: make the sample pre-commit hook script reject names with newlines, too Reindent closing bracket using tab instead of spaces Documentation/git-update-index: refer to 'ls-files'
2011-10-26Merge branch 'maint-1.7.3' into maint-1.7.4Libravatar Junio C Hamano3-5/+12
* maint-1.7.3: make the sample pre-commit hook script reject names with newlines, too Reindent closing bracket using tab instead of spaces Documentation/git-update-index: refer to 'ls-files'
2011-10-26Merge branch 'sn/doc-update-index-assume-unchanged' into maint-1.7.3Libravatar Junio C Hamano1-2/+5
* sn/doc-update-index-assume-unchanged: Documentation/git-update-index: refer to 'ls-files'
2011-10-26read-cache.c: fix index memory allocationLibravatar René Scharfe2-3/+53
estimate_cache_size() tries to guess how much memory is needed for the in-memory representation of an index file. It does that by using the file size, the number of entries and the difference of the sizes of the on-disk and in-memory structs -- without having to check the length of the name of each entry, which varies for each entry, but their sums are the same no matter the representation. Except there can be a difference. First of all, the size is really calculated by ce_size and ondisk_ce_size based on offsetof(..., name), not sizeof, which can be different. And entries are padded with 1 to 8 NULs at the end (after the variable name) to make their total length a multiple of eight. So in order to allocate enough memory to hold the index, change the delta calculation to be based on offsetof(..., name) and round up to the next multiple of eight. On a 32-bit Linux, this delta was used before: sizeof(struct cache_entry) == 72 sizeof(struct ondisk_cache_entry) == 64 --- 8 The actual difference for an entry with a filename length of one was, however (find the definitions are in cache.h): offsetof(struct cache_entry, name) == 72 offsetof(struct ondisk_cache_entry, name) == 62 ce_size == (72 + 1 + 8) & ~7 == 80 ondisk_ce_size == (62 + 1 + 8) & ~7 == 64 --- 16 So eight bytes less had been allocated for such entries. The new formula yields the correct delta: (72 - 62 + 7) & ~7 == 16 Reported-by: John Hsing <tsyj2007@gmail.com> Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-26make the sample pre-commit hook script reject names with newlines, tooLibravatar Jim Meyering1-2/+6
The sample pre-commit hook script would fail to reject a file name like "a\nb" because of the way newlines are handled in "$(...)". Adjust the test to count filtered bytes and require there be 0. Also print all diagnostics to standard error, not stdout, so they will actually be seen. Signed-off-by: Jim Meyering <meyering@redhat.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-26completion: fix issue with process substitution not working on Git for WindowsLibravatar Stefan Naewe1-1/+2
Git for Windows comes with a bash that doesn't support process substitution. It issues the following error when using git-completion.bash with GIT_PS1_SHOWUPSTREAM set: $ export GIT_PS1_SHOWUPSTREAM=1 sh.exe": cannot make pipe for process substitution: Function not implemented sh.exe": cannot make pipe for process substitution: Function not implemented sh.exe": <(git config -z --get-regexp '^(svn-remote\..*\.url|bash\.showupstream)$' 2>/dev/null | tr '\0\n' '\n '): ambiguous redirect Replace the process substitution with a 'here string'. Signed-off-by: Stefan Naewe <stefan.naewe@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-26gitweb/Makefile: Remove static/gitweb.js in the clean targetLibravatar Ramsay Jones1-1/+3
Since 9a86dd5 (gitweb: Split JavaScript for maintability, combining on build, 2011-04-28), static/gitweb.js has been a build product that should be cleaned upon "make clean". Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-26builtin/grep: simplify lock_and_read_sha1_file()Libravatar Junio C Hamano1-7/+3
As read_sha1_lock/unlock have been made aware of use_threads, this caller can be made a lot simpler. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-26builtin/grep: make lock/unlock into static inline functionsLibravatar Junio C Hamano1-5/+23
Signed-off-by: Junio C Hamano <gitster@pobox.com>