summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2009-07-22diff --cc: a lost line at the beginning of the file is shown incorrectlyJunio C Hamano
When combine-diff inspected the diff from one parent to the merge result, it misinterpreted a header in the form @@ -l,k +0,0 @@. This hunk header means that K lines were removed from the beginning of the file, so the lost lines must be queued to the sline that represents the first line of the merge result, but we incremented our pointer incorrectly and ended up queuing it to the second line, which in turn made the lossage appear _after_ the first line. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-07-22combine-diff.c: fix performance problem when folding common deleted linesJunio C Hamano
For a deleted line in a patch with the parent we are looking at, the append_lost() function finds the same line among a run of lines that were deleted from the same location by patches from parents we previously checked. This is so that patches with two parents @@ -1,4 +1,3 @@ @@ -1,4 +1,3 @@ one one -two -two three three -quatro -fyra +four +four can be coalesced into this sequence, reusing one line that describes the removal of "two" for both parents. @@@ -1,4 -1,4 +1,3 @@@ one --two three - quatro -frya ++four While reading the second patch (that removes "two" and then "fyra"), after finding where removal of the "two" matches, we need to find existing removal of "fyra" (if exists) in the removal list, but the match has to happen after all the existing matches (in this case "two"). The code used a naïve O(n^2) algorithm to compute this by scanning the whole removal list over and over again. This patch remembers where the next scan should be started in the existing removal list to avoid this. Noticed by Linus Torvalds. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-07-18checkout -f: deal with a D/F conflict entry correctlyJunio C Hamano
When we switch branches with "checkout -f", unpack_trees() feeds two cache_entries to oneway_merge() function in its src[] array argument. The zeroth entry comes from the current index, and the first entry represents what the merge result should be, taken from the tree recorded in the commit we are switching to. When we have a blob (either regular file or a symlink) in the index and in the work tree at path "foo", and the switched-to tree has "foo/bar", i.e. "foo" becomes a directory, src[0] is obviously that blob currently registered at "foo". Even though we do not have anything at "foo" in the switched-to tree, src[1] is _not_ NULL in this case. The unpack_trees() machinery places a special marker df_conflict_entry to signal that no blob exists at "foo", but it will become a directory that may have somthing underneath it (namely "foo/bar"), so a usual 3-way merge can notice the situation. But oneway_merge() codepath failed to notice this and passed the special marker directly to merged_entry(). This happens to remove the "foo" in the end because the df_conflict_entry does not have any name (hence the "error" message) and its addition in add_index_entry() is rejected, but it is wrong. Signed-off-by: Junio C Hamano <gitster@pobox.com> Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-07-16sha1_name.c: avoid unnecessary strbuf_releaseBrandon Casey
When we fall back to a standard for_each_reflog_ent() after failing to find the nth branch switch (or if we had a short reflog) with the call to for_each_recent_reflog_ent(), we do not need to free the memory allocated for our strbuf's since a strbuf_reset() will be performed in grab_nth_branch_switch() before assigning to the entry. Plus, the strbuf_release() negates the non-zero hint we initially gave to strbuf_init() just above these lines. Signed-off-by: Brandon Casey <drafnel@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-07-16refs.c: release file descriptor on error returnBrandon Casey
Signed-off-by: Brandon Casey <drafnel@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-07-08Merge branch 'cb/maint-fetch-refspec-wo-dst' into maintJunio C Hamano
* cb/maint-fetch-refspec-wo-dst: fetch: do not create ref from empty name
2009-07-08Merge branch 'cf/maint-remote-uploadpack-useconfig-fix' into maintJunio C Hamano
* cf/maint-remote-uploadpack-useconfig-fix: git-remote: fix missing .uploadpack usage for show command
2009-07-08Documentation: update description of shell aliasesSitaram Chamarty
Aliases that invoke shell commands start from the top-level directory, but this was not documented. Signed-off-by: Sitaram Chamarty <sitaramc@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-07-01request-pull: really really disable pagerMichal Marek
Earlier 476cc72 (request-pull: really disable pager, 2009-06-30) tried to use the correct environment variable to disable paging from multiple calls to "git log" and friends, but there was one extra call to "git log" that was not covered by the trick. Move the setting and exporting of GIT_PAGER much earlier in the script to cover everybody. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-30attr: plug minor memory leakRené Scharfe
Free the memory allocated for struct strbuf pathbuf when we're done. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-30request-pull: really disable pagerJunio C Hamano
ff06c74 (Improve request-pull to handle non-rebased branches, 2007-05-01) attempted to disable pager when running subcommands in this script, but with a wrong variable. If GIT_PAGER is set, it takes precedence over PAGER. Noticed by Michal Marek. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-30Makes some cleanup/review in gittutorialThadeu Lima de Souza Cascardo
There are some different but little cleanup changes to fix some missing quotes, to fix what seemed to be an unended sentence, to reident a little paragraph with too large a sentence and fix a branch name that was referred to twice later by another name. Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-30Makefile: git.o depends on library headersJohannes Sixt
This dependency was not yet specified anywhere else. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-30git-submodule documentation: fix foreach exampleMiklos Vajna
Backtick and apostrophe are asciidoc markup, so they should be escaped in order to get the expected result in the rendered manual page. Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-27gitweb/README: fix AliasMatch in exampleGiuseppe Bilotta
When combining "dumb client" and human-friendly access by using the '.git' extension to switch between the two, make sure the AliasMatch covers the entire request. Without a full match, a request for http://git.example.com/project/shortlog/branch..gitsomething would result in a 404 because the server would try to access the the project 'project/shortlog/branch.' The solution is still not bulletproof, so document the possible failing case. Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-27Test grep --and/--or/--notThomas Rast
Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-27Test git archive --remoteThomas Rast
Add a small test case for git archive --remote (and thus git-upload-archive), which so far went untested. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-25git-remote: fix missing .uploadpack usage for show commandChris Frey
For users pulling from machines with self compiled git installs, in non-PATH locations, they can set the config option remote.<name>.uploadpack to set the location of git-upload-pack. When using 'git remote show <name>', the remote HEAD check did not use the uploadpack configuration setting, and would not use the configured program. In builtin-remote.c, the config setting is already loaded with the call to remote_get(), so this patch passes that remote along to transport_get(). Signed-off-by: Chris Frey <cdfrey@foursquare.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-23fread does not return negative on errorRoel Kluin
size_t res cannot be less than 0. fread returns 0 on error. Reported-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-22t3700-add: add a POSIXPERM prerequisite to a new testJohannes Sixt
The new test does a 'chmod 0', which does not have the intended effect on Windows. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-22Merge branch 'sb/maint-1.6.0-add-config-fix' into maintJunio C Hamano
* sb/maint-1.6.0-add-config-fix: add: allow configurations to be overriden by command line
2009-06-22GIT 1.6.3.3v1.6.3.3Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-22Merge branch 'ak/maint-for-each-ref-no-lookup' into maintJunio C Hamano
* ak/maint-for-each-ref-no-lookup: for-each-ref: Do not lookup objects when they will not be used
2009-06-22Merge branch 'rc/maint-http-local-slot-fix' into maintJunio C Hamano
* rc/maint-http-local-slot-fix: http*: cleanup slot->local after fclose
2009-06-22Merge branch 'cb/maint-no-double-merge' into maintJunio C Hamano
* cb/maint-no-double-merge: refuse to merge during a merge
2009-06-22Merge branch 'mn/maint-iconv-autoconf' into maintJunio C Hamano
* mn/maint-iconv-autoconf: fix handling of iconv configuration options
2009-06-22Merge branch 'lt/maint-unsigned-left-shift' into maintJunio C Hamano
* lt/maint-unsigned-left-shift: Fix big left-shifts of unsigned char
2009-06-22Merge branch 'pb/maint-1.6.2-userdiff-fix' into maintJunio C Hamano
* pb/maint-1.6.2-userdiff-fix: upload-archive: fix infinite loop on Cygwin avoid exponential regex match for java and objc function names
2009-06-21attribute: whitespace set to true detects all errors known to gitJunio C Hamano
That is what the documentation says, but the code pretends as if all the known whitespace error tokens were given. Among the whitespace error tokens, there is one kind that loosens the rule when set: cr-at-eol. Which means that whitespace error token that is set to true ignores a newly introduced CR at the end, which is inconsistent with the documentation. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-21.gitattributes: CR at the end of the line is an errorNanako Shiraishi
When a CR is accidentally added at the end of a C source file in the git project tree, "git diff --check" doesn't detect it as an error. $ echo abQ | tr Q '\015' >>fast-import.c $ git diff --check I think this is because the "whitespace" attribute is set to *.[ch] files without specifying what kind of errors are caught. It makes git "notice all types of errors" (as described in the documentation), but I think it is incorrectly setting cr-at-eol, too, and hides this error. Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-21t3505: fix abuse of test_expect_codeJunio C Hamano
The test wanted to make sure that cherry-pick exits with status 1, but with the way it was placed after "git checkout master &&" meant that it could have misjudged success if checkout barfed with the same failure status. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-21Merge branch 'maint-1.6.2' into maintJunio C Hamano
* maint-1.6.2: git-show-ref.txt: remove word and make consistent git-svn documentation: fix typo in 'rebase vs. pull/merge' section use xstrdup, not strdup in ll-merge.c
2009-06-21Merge branch 'maint-1.6.1' into maint-1.6.2Junio C Hamano
* maint-1.6.1: git-show-ref.txt: remove word and make consistent git-svn documentation: fix typo in 'rebase vs. pull/merge' section use xstrdup, not strdup in ll-merge.c
2009-06-21Merge branch 'maint-1.6.0' into maint-1.6.1Junio C Hamano
* maint-1.6.0: git-show-ref.txt: remove word and make consistent git-svn documentation: fix typo in 'rebase vs. pull/merge' section use xstrdup, not strdup in ll-merge.c
2009-06-21git-show-ref.txt: remove word and make consistentStephen Boyd
Under is better than in because of the nested nature of the .git directory. "also using" sounds a little odd, plus we say combined with later on so just use that. Signed-off-by: Stephen Boyd <bebarino@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-21git-svn documentation: fix typo in 'rebase vs. pull/merge' sectionMiklos Vajna
Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-18add: allow configurations to be overriden by command lineStephen Boyd
Don't call git_config after parsing the command line options, otherwise the config settings will override any settings made by the command line. This can be seen by setting add.ignore_errors and then specifying --no-ignore-errors when using git-add. Signed-off-by: Stephen Boyd <bebarino@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-18http.c: fix compiling with libcurl 7.9.2Mark Lodato
Change the minimimum required libcurl version for the http.sslKey option to 7.9.3. Previously, preprocessor macros checked for >= 7.9.2, which is incorrect because CURLOPT_SSLKEY was introduced in 7.9.3. This now allows git to compile with libcurl 7.9.2. Signed-off-by: Mark Lodato <lodatom@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-18fetch: do not create ref from empty nameClemens Buchacher
Previously, the refspec "<src>:" would be expanded to "<src>:refs/heads/". Instead, treat an empty <dst> just like refspecs without a colon. Signed-off-by: Clemens Buchacher <drizzd@aon.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-18import-tars: support symlinksJohannes Schindelin
Without this patch, symbolic links are turned into empty files. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-18upload-archive: fix infinite loop on CygwinRené Scharfe
On Cygwin, poll() reports POLLIN even for file descriptors that have reached their end. This caused git upload-archive to be stuck in an infinite loop, as it only looked at the POLLIN flag. In addition to POLLIN, check if read() returned 0, which indicates end-of-file, and keep looping only as long as at least one of the file descriptors has input. This lets the following command finish on its own when run in a git repository on Cygwin, instead of it getting stuck after printing all file names: $ git archive -v --remote . HEAD >/dev/null Reported-by: Bob Kagy <bobkagy@gmail.com> Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-18avoid exponential regex match for java and objc function namesPaolo Bonzini
In the old regex ^[ \t]*(([ \t]*[A-Za-z_][A-Za-z_0-9]*){2,}[ \t]*\([^;]*)$ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ you can backtrack arbitrarily from [A-Za-z_0-9]* into [A-Za-z_], thus causing an exponential number of backtracks. Ironically it also causes the regex not to work as intended; for example "catch" can match the underlined part of the regex, the first repetition matching "c" and the second matching "atch". The replacement regex avoids this problem, because it makes sure that at least a space/tab is eaten on each repetition. In other words, a suffix of a repetition can never be a prefix of the next repetition. Signed-off-by: Paolo Bonzini <bonzini@gnu.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-18Fix big left-shifts of unsigned charLinus Torvalds
Shifting 'unsigned char' or 'unsigned short' left can result in sign extension errors, since the C integer promotion rules means that the unsigned char/short will get implicitly promoted to a signed 'int' due to the shift (or due to other operations). This normally doesn't matter, but if you shift things up sufficiently, it will now set the sign bit in 'int', and a subsequent cast to a bigger type (eg 'long' or 'unsigned long') will now sign-extend the value despite the original expression being unsigned. One example of this would be something like unsigned long size; unsigned char c; size += c << 24; where despite all the variables being unsigned, 'c << 24' ends up being a signed entity, and will get sign-extended when then doing the addition in an 'unsigned long' type. Since git uses 'unsigned char' pointers extensively, we actually have this bug in a couple of places. I may have missed some, but this is the result of looking at git grep '[^0-9 ][ ]*<<[ ][a-z]' -- '*.c' '*.h' git grep '<<[ ]*24' which catches at least the common byte cases (shifting variables by a variable amount, and shifting by 24 bits). I also grepped for just 'unsigned char' variables in general, and converted the ones that most obviously ended up getting implicitly cast immediately anyway (eg hash_name(), encode_85()). In addition to just avoiding 'unsigned char', this patch also tries to use a common idiom for the delta header size thing. We had three different variations on it: "& 0x7fUL" in one place (getting the sign extension right), and "& ~0x80" and "& 0x7f" in two other places (not getting it right). Apart from making them all just avoid using "unsigned char" at all, I also unified them to then use a simple "& 0x7f". I considered making a sparse extension which warns about doing implicit casts from unsigned types to signed types, but it gets rather complex very quickly, so this is just a hack. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-15pull, rebase: simplify to use die()Stephen Boyd
Signed-off-by: Stephen Boyd <bebarino@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-14use xstrdup, not strdup in ll-merge.cJim Meyering
Otherwise, a fluky allocation failure would cause merge configuration settings to be silently ignored. Signed-off-by: Jim Meyering <meyering@redhat.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-14Merge branch 'maint-1.6.2' into maintJunio C Hamano
* maint-1.6.2: git-rerere.txt: grammatical fixups and cleanups
2009-06-14Merge branch 'maint-1.6.1' into maint-1.6.2Junio C Hamano
* maint-1.6.1: git-rerere.txt: grammatical fixups and cleanups
2009-06-14Merge branch 'maint-1.6.0' into maint-1.6.1Junio C Hamano
* maint-1.6.0: git-rerere.txt: grammatical fixups and cleanups http-push.c::remove_locks(): fix use after free
2009-06-13git-rerere.txt: grammatical fixups and cleanupsStephen Boyd
Rewrite the gc section using unresolved and resolved instead of "not recorded". Add plurals and missing articles. Make some sentences have consistent tense. Try and be more active by removing "that" and simplifying sentences. The terms "hand-resolve" and "hand resolve" were used, so just use "hand resolve" to be more consistent. Signed-off-by: Stephen Boyd <bebarino@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-12Documentation: git-send-mail can take rev-list arg to drive format-patchPaolo Bonzini
The git-send-email docs do not mention except in the usage lines the combined patch formatting/sending ability of git-send-email. This patch expands on the possible arguments to git-send-email and explains the meaning of the rev-list argument. Signed-off-by: Paolo Bonzini <bonzini@gnu.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>