summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2006-08-27gitweb: Remove git_to_hash functionLibravatar Jakub Narebski1-20/+3
Remove git_to_hash function, which was to translate symbolic reference to hash, and it's use in git_blobdiff. We don't try so hard to guess filename if it was not provided. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-27gitweb: Remove unused git_get_{preceding,following}_referencesLibravatar Jakub Narebski1-51/+0
Remove unused (and with errors in implementation) git_get_{preceding,following}_references subroutines. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-27gitweb: Fix typo in git_patchset_bodyLibravatar Jakub Narebski1-1/+1
Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-26gitweb: Fix typo in git_difftree_bodyLibravatar Jakub Narebski1-1/+1
Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-26gitweb: blobs defined by non-textual hash ids can be cachedLibravatar Jakub Narebski1-3/+17
Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-26gitweb: Improve comments about gitweb features configurationLibravatar Jakub Narebski1-9/+16
Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-26gitweb: Remove workaround for git-diff bug fixed in f82cd3cLibravatar Jakub Narebski1-2/+1
Remove workaround in git_blobdiff for error in git-diff (showing reversed diff for diff of blobs), corrected in commit f82cd3c Fix "git diff blob1 blob2" showing the diff in reverse. which is post 1.4.2-rc2 commit. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-26Merge branch 'master' into gl/webLibravatar Junio C Hamano73-448/+661
* master: (34 commits) gitweb: git_annotate didn't expect negative numeric timezone git-svn: add the 'dcommit' command git-svn: recommend rebase for syncing against an SVN repo git-svn: establish new connections on commit after fork describe: fix off-by-one error in --abbrev=40 handling git-svn(1): improve asciidoc markup gitview.txt: improve asciidoc markup git(7): put the synopsis in a verse style paragraph gitk(1): expand the manpage to look less like a template git-blame(1): mention options in the synopsis and advertise pickaxe git-ls-remote(1): document --upload-pack git-apply(1): document missing options and improve existing ones update-index -g n is in fact unused, and is later shadowed. use name[len] in switch directly, instead of creating a shadowed variable. builtin-grep.c: remove unused debugging piece. remove ugly shadowing of loop indexes in subloops. missing 'static' keywords git_dir holds pointers to local strings, hence MUST be const. avoid to use error that shadows the function name, use err instead. ...
2006-08-26Merge branch 'gl/cleanup'Libravatar Junio C Hamano35-83/+90
* gl/cleanup: Convert memset(hash,0,20) to hashclr(hash). Convert memcpy(a,b,20) to hashcpy(a,b).
2006-08-26gitweb: git_annotate didn't expect negative numeric timezoneLibravatar Jakub Narebski1-1/+1
Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-26git-svn: add the 'dcommit' commandLibravatar Eric Wong2-1/+61
This is a high-level wrapper around the 'commit-diff' command and used to produce cleaner history against the mirrored repository through rebase/reset usage. It's basically a more polished version of this: for i in `git rev-list --no-merges remotes/git-svn..HEAD | tac`; do git-svn commit-diff $i~1 $i done git reset --hard remotes/git-svn Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-25git-svn: recommend rebase for syncing against an SVN repoLibravatar Eric Wong1-2/+20
Does this make sense to other git-svn users out there? pull can give funky history unless you understand how git-svn works internally, which users should not be expected to do. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-25git-svn: establish new connections on commit after forkLibravatar Eric Wong1-0/+4
SVN seems to have a problem with https:// repositories from time-to-time when doing multiple, sequential commits. This problem is not consistently reproducible without the patch, but it should go away entirely with this patch... Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-25describe: fix off-by-one error in --abbrev=40 handlingLibravatar Jonas Fonseca1-2/+2
Signed-off-by: Jonas Fonseca <fonseca@diku.dk> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-25gitweb: Remove creating directory for temporary filesLibravatar Jakub Narebski1-6/+0
Remove $git_temp variable which held location for temporary files needed by git_diff_print, and removed creating $git_temp directory. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-25gitweb: Remove git_diff_print subroutineLibravatar Jakub Narebski1-71/+0
Remove git_diff_print subroutine, used to print diff in previous versions of "diff" actions, namely git_commitdiff, git_commitdiff_plain, git_blobdiff, git_blobdiff_plain. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-25gitweb: git_blobdiff_plain is git_blobdiff('plain')Libravatar Jakub Narebski1-25/+68
git_blobdiff and git_blobdiff_plain are now collapsed into one subroutine git_blobdiff, with format (currently 'html' which is default format corresponding to git_blobdiff, and 'plain' corresponding to git_blobdiff_plain) specified in argument. blobdiff_plain format is now generated either by git-diff-tree or by git-diff. Added X-Git-Url: header. From-file and to-file name in header are corrected. Note that for now commitdiff_plain does not detect renames and copying, while blobdiff_plain does. While at it, set expires to "+1d" for non-textual hash ids. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-25gitweb: Use git-diff-tree or git-diff patch output for blobdiffLibravatar Jakub Narebski1-17/+132
This is second part of removing gitweb dependency on external diff (used in git_diff_print). Get rid of git_diff_print invocation in git_blobdiff, and use either git-diff-tree (when both hash_base and hash_parent_base are provided) patch format or git-diff patch format (when only hash and hash_parent are provided) for output. Supported URI schemes, and output formats: * New URI scheme: both hash_base and hash_parent_base (trees-ish containing blobs versions we want to compare) are provided. Also either filename is provided, or hash (of blob) is provided (we try to find filename then). For this scheme we have copying and renames detection, mode changes, file types etc., and information extended diff header is correct. * Old URI scheme: hash_parent_base is not provided, we use hash and hash_parent to directly compare blobs using git-diff. If no filename is given, blobs hashes are used in place of filenames. This scheme has always "blob" as file type, it cannot detect mode changes, and we rely on CGI parameters to provide name of the file. Added git_to_hash subroutine, which transforms symbolic name or list of symbolic name to hash or list of hashes using git-rev-parse. To have "blob" instead of "unknown" (or "file" regardless of the type) in "gitweb diff header" for legacy scheme, file_type function now returns its argument if it is not octal string. Added support for fake "2" status code in git_patchset_body. Such code is generated by git_blobdiff in legacy scheme case. ATTENTION: The order of arguments (operands) to git-diff is reversed (sic!) to have correct diff in the legacy (no hash_parent_base) case. $hash_parent, $hash ordering is commented out, as it gives reversed patch (at least for git version 1.4.1.1) as compared to output in new scheme and output of older gitweb version. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-25gitweb: Change here-doc back for style consistency in git_blobdiffLibravatar Jakub Narebski1-4/+2
Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-25gitweb: Always display link to blobdiff_plain in git_blobdiffLibravatar Jakub Narebski1-7/+7
Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-25gitweb: Add invisible hyperlink to from-file/to-file diff headerLibravatar Jakub Narebski2-4/+20
Change replacing hashes as from-file/to-file with filenames from difftree to adding invisible (except underlining on hover/mouseover) hyperlink to from-file/to-file blob. /dev/null as from-file or to-file is not changed (is not hyperlinked). This makes two-file from-file/to-file unified diff header parsing in git_patchset_body more generic, and not only for legacy blobdiffs. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-25gitweb: Parse two-line from-file/to-file diff header in git_patchset_bodyLibravatar Jakub Narebski2-1/+19
Parse two-line from-file/to-file unified diff header in git_patchset_body directly, instead of leaving pretty-printing to format_diff_line function. Hashes as from-file/to-file are replaced by proper from-file and to-file names (from $diffinfo); in the future we can put hyperlinks there. This makes possible to do blobdiff with only blobs hashes. The lines in two-line unified diff header have now class "from_file" and "to_file"; the style is chosen to match previous output (classes "rem" and "add" because of '-' and '+' as first character of patch line). Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-25gitweb: Allow for pre-parsed difftree info in git_patchset_bodyLibravatar Jakub Narebski1-25/+30
Preparation for converting git_blobdiff and git_blobdiff_plain to use git-diff-tree patch format to generate patches. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-25gitweb: Add support for hash_parent_base parameter for blobdiffsLibravatar Jakub Narebski1-10/+27
Add support for hash_parent_base in input validation part and in href() function. Add proper hash_parent_base to all calls to blobdiff and blobdiff_plain action URLs. Use hash_parent_base as hash_base for blobs of hash_parent. To be used in future rewrite of git_blobdiff and git_blobdiff_plain. While at it, move project before action in ordering CGI parameters in href(). Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-25gitweb: Use git_get_name_rev_tags for commitdiff_plain X-Git-Tag: headerLibravatar Jakub Narebski1-7/+3
Use git_get_rev_name_tags function for X-Git-Tag: header in git_commitdiff('plain'), i.e. for commitdiff_plain action. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-25gitweb: Add git_get_rev_name_tags functionLibravatar Jakub Narebski1-0/+16
Add git_get_rev_name_tags function, for later use in git_commitdiff('plain') for X-Git-Tag: header. This function, contrary to the call to git_get_following_references($hash, "tags"); _does_ strip "tags/" and returns bare tag name. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-25gitweb: Faster return from git_get_preceding_references if possibleLibravatar Jakub Narebski1-3/+2
Return on first ref found when git_get_preceding_references is called in scalar context Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-25gitweb: Add git_get_{following,preceding}_references functionsLibravatar Jakub Narebski1-0/+52
Adds git_get_following_references function, based on code which was used in git_commitdiff_plain to generate X-Git-Tag: header, and companion git_get_preceding_references function. Both functions return array of all references of given type (as returned by git_get_references) following/preceding given commit in array (list) context, and last following/first preceding ref in scalar context. Stripping ref (list of refs) of "$type/" (e.g. "tags/") is left to caller. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-25gitweb: Streamify patch output in git_commitdiffLibravatar Jakub Narebski1-8/+7
Change output of patch(set) in git_commitdiff from slurping whole diff in @patchset array before processing, to passing file descriptor to git_patchset_body. Advantages: faster, incremental output, smaller memory footprint. Disadvantages: cannot react when there is error during closing file descriptor. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-25gitweb: Remove invalid comment in format_diff_lineLibravatar Jakub Narebski1-1/+0
Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-25gitweb: Show information about incomplete lines in commitdiffLibravatar Jakub Narebski2-1/+5
In format_diff_line, instead of skipping errors/incomplete lines, for example "\ No newline at end of file" in HTML pretty-printing of diff, use "incomplete" class for div. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-25gitweb: Use git-diff-tree patch output for commitdiffLibravatar Jakub Narebski1-122/+201
Get rid of git_diff_print invocation in git_commitdiff and therefore external diff (/usr/bin/diff) invocation, and use only git-diff-tree to generate patch. git_commitdiff and git_commitdiff_plain are collapsed into one subroutine git_commitdiff, with format (currently 'html' which is default format corresponding to git_commitdiff, and 'plain' corresponding to git_commitdiff_plain) specified in argument. Separate patch (diff) pretty-printing into git_patchset_body. It is used in git_commitdiff. Separate patch (diff) line formatting from git_diff_print into format_diff_line function. It is used in git_patchset_body. While at it, add $hash parameter to git_difftree_body, according to rule that inner functions should use parameter passing, and not global variables. CHANGES TO OUTPUT: * "commitdiff" now products patches with renaming and copying detection (git-diff-tree is invoked with -M and -C options). Empty patches (mode changes and pure renames and copying) are not written currently. Former version broke renaming and copying, and didn't notice mode changes, like this version. * "commitdiff" output is now divided into several div elements of class "log", "patchset" and "patch". * "commitdiff_plain" now only generates X-Git-Tag: line only if there is tag pointing to the current commit. Former version which wrote first tag following current commit was broken[*1*]; besides we are interested rather in tags _preceding_ the commit, and _heads_ following the commit. X-Git-Url: now is current URL; former version tried[*2*] to output URL to HTML version of commitdiff. * "commitdiff_plain" is generated by git-diff-tree, and has therefore has git specific extensions to diff format: "git diff" header and optional extended header lines. FOOTNOTES [*1*] First it generated rev-list starting from HEAD even if hash_base parameter was set, second it wasn't corrected according to changes made in git_get_references (formerly read_info_ref) output, third even for older version of read_info_ref output it didn't work for multiple tags pointing to the current commit (rare). [*2*] It wrote URL for commitdiff without hash_parent, which produces diff to first parent and is not the same as current diff if it is diff of merge commit to non-first parent. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-25git-svn(1): improve asciidoc markupLibravatar Jonas Fonseca1-85/+114
Use list continuation to have better wrapping. This accounts for most of the changes because it reindents a lot of text without applying other changes. Use cross-referencing for interlinking and the gitlink macro for pointing to other tools in the git suite. Signed-off-by: Jonas Fonseca <fonseca@diku.dk> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-25gitview.txt: improve asciidoc markupLibravatar Jonas Fonseca1-23/+33
Signed-off-by: Jonas Fonseca <fonseca@diku.dk> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-25git(7): put the synopsis in a verse style paragraphLibravatar Jonas Fonseca1-1/+2
... so it wraps properly in small terminals. Signed-off-by: Jonas Fonseca <fonseca@diku.dk> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-25gitk(1): expand the manpage to look less like a templateLibravatar Jonas Fonseca1-10/+50
Add a short description and document a few selected options additionally to the different "entities" in the standard calling convention. Advertise other git repository browsers. Lastly, climb Mount Ego. Signed-off-by: Jonas Fonseca <fonseca@diku.dk> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-25git-blame(1): mention options in the synopsis and advertise pickaxeLibravatar Jonas Fonseca1-6/+23
Inspired by the cvs annotate documentation improve and expand the man page to also mention the limitations of file annotations. Since people coming from the SVN/CVS world might first look here, also briefly advertise how the pickaxe interface makes it easy to go beyond these limitation. Signed-off-by: Jonas Fonseca <fonseca@diku.dk> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-25git-ls-remote(1): document --upload-packLibravatar Jonas Fonseca1-4/+14
... and mention that '.' will list the local repo references. Signed-off-by: Jonas Fonseca <fonseca@diku.dk> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-25git-apply(1): document missing options and improve existing onesLibravatar Jonas Fonseca1-7/+39
Signed-off-by: Jonas Fonseca <fonseca@diku.dk> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-23update-index -gLibravatar Junio C Hamano2-4/+4
I often find myself typing this but the common abbreviation "g" for "again" has not been supported so far for some unknown reason. Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-23n is in fact unused, and is later shadowed.Libravatar Pierre Habouzit1-3/+3
date.c::approxidate_alpha() counts the number of alphabets while moving the pointer but does not use the count. Signed-off-by: Pierre Habouzit <madcoder@debian.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-23use name[len] in switch directly, instead of creating a shadowed variable.Libravatar Pierre Habouzit1-3/+1
builtin-apply.c defines a local variable 'c' which is used only once and then later gets shadowed by another instance of 'c'. Signed-off-by: Pierre Habouzit <madcoder@debian.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-23builtin-grep.c: remove unused debugging piece.Libravatar Junio C Hamano1-3/+0
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-23remove ugly shadowing of loop indexes in subloops.Libravatar Pierre Habouzit2-6/+6
builtin-mv.c and git.c has a nested loop that is governed by a variable 'i', but they shadow it with another instance of 'i'. Signed-off-by: Pierre Habouzit <madcoder@debian.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-23missing 'static' keywordsLibravatar Pierre Habouzit2-2/+2
builtin-tar-tree.c::git_tar_config() and http-push.c::add_one_object() are not used outside their own files. Signed-off-by: Pierre Habouzit <madcoder@debian.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-23git_dir holds pointers to local strings, hence MUST be const.Libravatar Pierre Habouzit2-4/+5
Signed-off-by: Pierre Habouzit <madcoder@debian.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-23avoid to use error that shadows the function name, use err instead.Libravatar Pierre Habouzit2-8/+8
builtin-apply.c and builtin-push.c uses a local variable called 'error' which shadows the error() function. Signed-off-by: Pierre Habouzit <madcoder@debian.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-23Convert memset(hash,0,20) to hashclr(hash).Libravatar Junio C Hamano6-5/+9
In the same spirit as hashcmp() and hashcpy(). Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-23Convert memcpy(a,b,20) to hashcpy(a,b).Libravatar Shawn Pearce34-78/+81
This abstracts away the size of the hash values when copying them from memory location to memory location, much as the introduction of hashcmp abstracted away hash value comparsion. A few call sites were using char* rather than unsigned char* so I added the cast rather than open hashcpy to be void*. This is a reasonable tradeoff as most call sites already use unsigned char* and the existing hashcmp is also declared to be unsigned char*. [jc: Splitted the patch to "master" part, to be followed by a patch for merge-recursive.c which is not in "master" yet. Fixed the cast in the latter hunk to combine-diff.c which was wrong in the original. Also converted ones left-over in combine-diff.c, diff-lib.c and upload-pack.c ] Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-23Fix a comparison bug in diff-delta.cLibravatar Pierre Habouzit1-1/+1
(1 << i) < hspace is compared in the `int` space rather that in the unsigned one. the result will be wrong if hspace is between 0x40000000 and 0x80000000. Signed-off-by: Pierre Habouzit <madcoder@debian.org> Signed-off-by: Junio C Hamano <junkio@cox.net>