aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* Merge branch 'pg/maint-1.7.9-am-where-is-patch'Junio C Hamano2012-07-22
|\ | | | | | | | | | | | | | | When "git am" failed, old timers knew to check .git/rebase-apply/patch to see what went wrong, but we never told the users about it. * pg/maint-1.7.9-am-where-is-patch: am: indicate where a failed patch is to be found
| * am: indicate where a failed patch is to be foundPaul Gortmaker2012-07-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If "git am" fails to apply something, the end user may need to know where to find the patch that failed to apply, so that the user can do other things (e.g. trying "GNU patch" on it, running "diffstat" to see what it tried to change, etc.) The input to "am" may have contained more than one patch, or the message may have been MIME encoded, and knowing what the user fed to "am" does not help very much for this purpose. Also introduce advice.amworkdir configuration to allow people who learned where to look to squelch this message. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'jl/maint-1.7.10-recurse-submodules-with-symlink'Junio C Hamano2012-07-22
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | When "git submodule add" clones a submodule repository, it can get confused where to store the resulting submodule repository in the superproject's .git/ directory when there is a symbolic link in the path to the current directory. * jl/maint-1.7.10-recurse-submodules-with-symlink: submodules: don't stumble over symbolic links when cloning recursively
| * | submodules: don't stumble over symbolic links when cloning recursivelyJens Lehmann2012-07-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since 69c3051 (submodules: refactor computation of relative gitdir path) cloning a submodule recursively fails for nested submodules when a symbolic link is part of the path to the work tree of the superproject. This happens when module_clone() tries to find the relative paths between the work tree and the git dir. When a symbolic link in current $PWD points to a directory that is at a different level, then determining the number of "../" needed to traverse to the superproject's work tree leads to a wrong result. As there is no portable way to say "pwd -P", use cd_to_toplevel to remove the link from $PWD, which fixes this problem. A test for this issue has been added to t7406. Reported-by: Bob Halley <halley@play-bow.org> Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Merge branch 'ms/daemon-doc-typo'Junio C Hamano2012-07-22
|\ \ \ | | | | | | | | | | | | | | | | * ms/daemon-doc-typo: Documentation/git-daemon: add missing word
| * | | Documentation/git-daemon: add missing wordMichael Schubert2012-07-16
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Michael Schubert <mschub@elegosoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | Merge branch 'lk/more-helpful-status-hints'Junio C Hamano2012-07-22
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | * lk/more-helpful-status-hints: status: color in-progress message like other header messages
| * | | | status: color in-progress message like other header messagesJeff King2012-07-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The "status" command recently learned to describe the in-progress operation in its long output format (e.g., rebasing, am, etc). This message gets its own slot in the color table, even though it is not configurable. As a result, if the user has set color.status.header to a non-default value, this message will not match (and cannot be made to match, as there is no config option). It is probably more sane to just color it like the rest of the text (i.e., just use color.status.header). This would not allow users to customize the color of this message independently, but they cannot do that with the current code anyway, and if somebody wants to build customizable colorization later, this patch does not make it much harder to do so. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | Merge branch 'jc/sha1-name-more'Junio C Hamano2012-07-22
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Teaches the object name parser things like a "git describe" output is always a commit object, "A" in "git log A" must be a committish, and "A" and "B" in "git log A...B" both must be committish, etc., to prolong the lifetime of abbreviated object names. * jc/sha1-name-more: (27 commits) t1512: match the "other" object names t1512: ignore whitespaces in wc -l output rev-parse --disambiguate=<prefix> rev-parse: A and B in "rev-parse A..B" refer to committish reset: the command takes committish commit-tree: the command wants a tree and commits apply: --build-fake-ancestor expects blobs sha1_name.c: add support for disambiguating other types revision.c: the "log" family, except for "show", takes committish revision.c: allow handle_revision_arg() to take other flags sha1_name.c: introduce get_sha1_committish() sha1_name.c: teach lookup context to get_sha1_with_context() sha1_name.c: many short names can only be committish sha1_name.c: get_sha1_1() takes lookup flags sha1_name.c: get_describe_name() by definition groks only commits sha1_name.c: teach get_short_sha1() a commit-only option sha1_name.c: allow get_short_sha1() to take other flags get_sha1(): fix error status regression sha1_name.c: restructure disambiguation of short names sha1_name.c: correct misnamed "canonical" and "res" ...
| * | | | | t1512: match the "other" object namesJunio C Hamano2012-07-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The test creates 16 objects that share the same prefix, and two other objects that do not. Tweak the test so that the other two share the same prefix that is different from the one that is shared by the 16. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | t1512: ignore whitespaces in wc -l outputJunio C Hamano2012-07-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some implementations of sed (e.g. MacOS X) have whitespaces in the output of "wc -l" that reads from the standard input. Ignore these whitespaces by not quoting the command substitution to be compared with the constant "16". Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | rev-parse --disambiguate=<prefix>Junio C Hamano2012-07-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new option allows you to feed an ambiguous prefix and enumerate all the objects that share it as a prefix of their object names. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | rev-parse: A and B in "rev-parse A..B" refer to committishJunio C Hamano2012-07-09
| | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | reset: the command takes committishJunio C Hamano2012-07-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is not strictly correct, in that resetting selected index entries from corresponding paths out of a given tree without moving HEAD is a valid operation, and in such case a tree-ish would suffice. But the existing code already requires a committish in the codepath, so let's be consistent with it for now. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | commit-tree: the command wants a tree and commitsJunio C Hamano2012-07-09
| | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | apply: --build-fake-ancestor expects blobsJunio C Hamano2012-07-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The "index" line read from the patch to reconstruct a partial preimage tree records the object names of blob objects. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | sha1_name.c: add support for disambiguating other typesJunio C Hamano2012-07-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This teaches the revision parser that in "$name:$path" (used for a blob object name), "$name" must be a tree-ish. There are many more places where we know what types of objects are called for. This patch adds support for "commit", "treeish", "tree", and "blob", which could be used in the following contexts: - "git apply --build-fake-ancestor" reads the "index" lines from the patch; they must name blob objects (not even "blob-ish"); - "git commit-tree" reads a tree object name (not "tree-ish"), and zero or more commit object names (not "committish"); - "git reset $rev" wants a committish; "git reset $rev -- $path" wants a treeish. They will come in later patches in the series. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | revision.c: the "log" family, except for "show", takes committishJunio C Hamano2012-07-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a field to setup_revision_opt structure and allow these callers to tell the setup_revisions command parsing machinery that short SHA1 it encounters are meant to name committish. This step does not go all the way to connect the setup_revisions() to sha1_name.c yet. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | revision.c: allow handle_revision_arg() to take other flagsJunio C Hamano2012-07-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The existing "cant_be_filename" that tells the function that the caller knows the arg is not a path (hence it does not have to be checked for absense of the file whose name matches it) is made into a bit in the flag word. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | sha1_name.c: introduce get_sha1_committish()Junio C Hamano2012-07-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Many callers know that the user meant to name a committish by syntactical positions where the object name appears. Calling this function allows the machinery to disambiguate shorter-than-unique abbreviated object names between committish and others. Note that this does NOT error out when the named object is not a committish. It is merely to give a hint to the disambiguation machinery. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | sha1_name.c: teach lookup context to get_sha1_with_context()Junio C Hamano2012-07-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The function takes user input string and returns the object name (binary SHA-1) with mode bits and path when the object was looked up in a tree. Additionally give hints to help disambiguation of abbreviated object names when the caller knows what it is looking for. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | sha1_name.c: many short names can only be committishJunio C Hamano2012-07-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We know that the token "$name" that appear in "$name^{commit}", "$name^4", "$name~4" etc. can only name a committish (either a commit or a tag that peels to a commit). Teach get_short_sha1() to take advantage of that knowledge when disambiguating an abbreviated SHA-1 given as an object name. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | sha1_name.c: get_sha1_1() takes lookup flagsJunio C Hamano2012-07-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is to pass the disambiguation hints from the caller down the callchain. Nothing is changed in this step, as everybody just passes 0 in the flag. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | sha1_name.c: get_describe_name() by definition groks only commitsJunio C Hamano2012-07-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Teach get_describe_name() to pass the disambiguation hint down the callchain to get_short_sha1(). Also add tests to show various syntactic elements that we could take advantage of the object type information to help disambiguration of abbreviated object names. Many of them are marked as broken, and some of them will be fixed in later patches in this series. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | sha1_name.c: teach get_short_sha1() a commit-only optionJunio C Hamano2012-07-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the caller knows that the parameter is meant to name a commit, e.g. "56789a" in describe name "v1.2.3-4-g56789a", pass that as a hint so that lower level can use it to disambiguate objects when there is only one commit whose name begins with 56789a even if there are objects of other types whose names share the same prefix. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | sha1_name.c: allow get_short_sha1() to take other flagsJunio C Hamano2012-07-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of a separate "int quietly" argument, make it take "unsigned flags" so that we can pass other options to it. The bit assignment of this flag word is exposed in cache.h because the mechanism will be exposed to callers of the higher layer in later commits in this series. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | get_sha1(): fix error status regressionJunio C Hamano2012-07-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In finish_object_disambiguation(), if the candidate hasn't been checked, there are two cases: - It is the first and only object that match the prefix; or - It replaced another object that matched the prefix but that object did not satisfy ds->fn() callback. And the former case we set ds->candidate_ok to true without doing anything else, while for the latter we check the candidate, which may set ds->candidate_ok to false. At this point in the code, ds->candidate_ok can be false only if this last-round check found that the candidate does not pass the check, because the state after update_candidates() returns cannot satisfy !ds->ambiguous && ds->candidate_exists && ds->candidate_checked and !ds->canidate_ok at the same time. Hence, when we execute this "return", we know we have seen more than one object that match the prefix (and none of them satisfied ds->fn), meaning that we should say "the short name is ambiguous", not "there is no object that matches the prefix". Noticed by Jeff King. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | sha1_name.c: restructure disambiguation of short namesJunio C Hamano2012-07-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We try to find zero, one or more matches from loose objects and packed objects independently and then decide if the given short object name is unique across them. Instead, introduce a "struct disambiguate_state" that keeps track of what we have found so far, that can be one of: - We have seen one object that _could_ be what we are looking for; - We have also checked that object for additional constraints (if any), and found that the object satisfies it; - We have also checked that object for additional constraints (if any), and found that the object does not satisfy it; or - We have seen more than one objects that satisfy the constraints. and pass it to the enumeration functions for loose and packed objects. The disambiguation state can optionally take a callback function that takes a candidate object name and reports if the object satisifies additional criteria (e.g. when the caller knows that the short name must refer to a commit, this mechanism can be used to check the type of the given object). Compared to the earlier attempt, this round avoids the optional check if there is only one candidate that matches the short name in the first place. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | sha1_name.c: correct misnamed "canonical" and "res"Junio C Hamano2012-07-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These are hexadecimal and binary representation of the short object name given to the callchain as its input. Rename them with _pfx suffix to make it clear they are prefixes, and call them hex and bin respectively. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | sha1_name.c: refactor find_short_packed_object()Junio C Hamano2012-07-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Extract the logic to find object(s) that match a given prefix inside a single pack into a separate helper function, and give it a bit more comment. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | sha1_name.c: rename "now" to "current"Junio C Hamano2012-07-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This variable points at the element we are currently looking at, and does not have anything to do with the current time which the name "now" implies. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | sha1_name.c: clarify what "fake" is for in find_short_object_filename()Junio C Hamano2012-07-03
| | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | sha1_name.c: get rid of get_sha1_with_mode()Junio C Hamano2012-07-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are only two callers, and they will benefit from being able to pass disambiguation hints to underlying get_sha1_with_context() API once it happens. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | sha1_name.c: get rid of get_sha1_with_mode_1()Junio C Hamano2012-07-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The only external caller is setup.c that tries to give a nicer error message when an object name is misspelt (e.g. "HEAD:cashe.h"). Retire it and give the caller a dedicated and more intuitive API function maybe_die_on_misspelt_object_name(). Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | sha1_name.c: hide get_sha1_with_context_1() uglinessJunio C Hamano2012-07-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is no outside caller that cares about the "only-to-die" ugliness. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | sha1_name.c: indentation fixJunio C Hamano2012-06-18
| | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | Merge branch 'jc/maint-filter-branch-epoch-date'Junio C Hamano2012-07-22
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In 1.7.9 era, we taught "git rebase" about the raw timestamp format but we did not teach the same trick to "filter-branch", which rolled a similar logic on its own. Because of this, "filter-branch" failed to rewrite commits with ancient timestamps. * jc/maint-filter-branch-epoch-date: t7003: add test to filter a branch with a commit at epoch date.c: Fix off by one error in object-header date parsing filter-branch: do not forget the '@' prefix to force git-timestamp
| * | | | | | t7003: add test to filter a branch with a commit at epochJunio C Hamano2012-07-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Running filter-branch on a history that has a commit with timestamp at epoch used to fail, but it should have been fixed. Add test to make sure it won't break again. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | date.c: Fix off by one error in object-header date parsingJunio C Hamano2012-07-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is perfectly OK for a valid decimal integer to begin with '9' but 116eb3a (parse_date(): allow ancient git-timestamp, 2012-02-02) did not express the range correctly. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | filter-branch: do not forget the '@' prefix to force git-timestampJunio C Hamano2012-07-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For some reason, this script reinvents, instead of refactoring the existing one in git-sh-setup, the logic to grab ident information from an existing commit; it was missed when the corresponding logic in git-sh-setup was updated with 2c733fb (parse_date(): '@' prefix forces git-timestamp, 2012-02-02). Teach the script that it is OK to have a way ancient timestamp in the commits that are being filtered. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | Update draft release notes for 7th batchJunio C Hamano2012-07-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | Merge branch 'tg/maint-cache-name-compare'Junio C Hamano2012-07-15
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Even though the index can record pathnames longer than 1<<12 bytes, in some places we were not comparing them in full, potentially replacing index entries instead of adding. * tg/maint-cache-name-compare: cache_name_compare(): do not truncate while comparing paths
| * | | | | | | cache_name_compare(): do not truncate while comparing pathsJunio C Hamano2012-07-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We failed to use ce_namelen() equivalent and instead only compared up to the CE_NAMEMASK bytes by mistake. Adding an overlong path that shares the same common prefix as an existing entry in the index did not add a new entry, but instead replaced the existing one, as the result. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | | Merge branch 'jk/index-pack-streaming-fix'Junio C Hamano2012-07-15
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The streaming index-pack introduced in 1.7.11 had a data corruption bug, and this should fix it. * jk/index-pack-streaming-fix: index-pack: loop while inflating objects in unpack_data
| * | | | | | | | index-pack: loop while inflating objects in unpack_dataJeff King2012-07-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the unpack_data function is given a consume() callback, it unpacks only 64K of the input at a time, feeding it to git_inflate along with a 64K output buffer. However, because we are inflating, there is a good chance that the output buffer will fill before consuming all of the input. In this case, we need to loop on git_inflate until we have fed the whole input buffer, feeding each chunk of output to the consume buffer. The current code does not do this, and as a result, will fail the loop condition and trigger a fatal "serious inflate inconsistency" error in this case. While we're rearranging the loop, let's get rid of the extra last_out pointer. It is meant to point to the beginning of the buffer that we feed to git_inflate, but in practice this is always the beginning of our same 64K buffer, because: 1. At the beginning of the loop, we are feeding the buffer. 2. At the end of the loop, if we are using a consume() function, we reset git_inflate's pointer to the beginning of the buffer. If we are not using a consume() function, then we do not care about the value of last_out at all. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | | | Merge branch 'jk/maint-commit-amend-only-no-paths'Junio C Hamano2012-07-15
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "git commit --amend --only --" was meant to allow "Clever" people to rewrite the commit message without making any change even when they have already changes for the next commit added to their index, but it never worked as advertised since it was introduced in 1.3.0 era. * jk/maint-commit-amend-only-no-paths: commit: fix "--amend --only" with no pathspec
| * | | | | | | | | commit: fix "--amend --only" with no pathspecJeff King2012-07-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we do not have any pathspec, we typically disallow an explicit "--only", because it makes no sense (your commit would, by definition, be empty). But since 6a74642 (git-commit --amend: two fixes., 2006-04-20), we have allowed "--amend --only" with the intent that it would amend the commit, ignoring any contents staged in the index. However, while that commit allowed the combination, we never actually implemented the logic to make it work. The current code notices that we have no pathspec and assumes we want to do an as-is commit (i.e., the "--only" is ignored). Instead, we must make sure to follow the partial-commit code-path. We also need to tweak the list_paths function to handle a NULL pathspec. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | | | | Merge branch 'cw/amend-commit-without-message'Junio C Hamano2012-07-15
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "commit --amend" used to refuse amending a commit with an empty log message, with or without "--allow-empty-message". * cw/amend-commit-without-message: Allow edit of empty message with commit --amend
| * | | | | | | | | | Allow edit of empty message with commit --amendChris Webb2012-07-09
| | |_|_|_|_|_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "git commit --amend" used on a commit with an empty message fails unless -m is given, whether or not --allow-empty-message is specified. Allow it to proceed to the editor with an empty commit message. Unless --allow-empty-message is in force, it will still abort later if an empty message is saved from the editor (this check was already necessary to prevent a non-empty commit message being edited to an empty one). Add a test for --amend --edit of an empty commit message which fails without this fix, as it's a rare case that won't get frequently tested otherwise. Signed-off-by: Chris Webb <chris@arachsys.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | | | | Merge branch 'jn/makefile-cleanup'Junio C Hamano2012-07-15
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tightens dependency rules to avoid unnecessary recompilation, and cleans up our Makefile in general. * jn/makefile-cleanup: Makefile: document ground rules for target-specific dependencies Makefile: move GIT-VERSION-FILE dependencies closer to use Makefile: build instaweb similar to other scripts Makefile: update scripts when build-time parameters change Makefile: do not replace @@GIT_VERSION@@ in shell scripts Makefile: split prefix flags from GIT-CFLAGS Makefile: be silent when only GIT_USER_AGENT changes Makefile: split GIT_USER_AGENT from GIT-CFLAGS Makefile: do not replace @@GIT_USER_AGENT@@ in scripts Makefile: apply dependencies consistently to sparse/asm targets Makefile: do not have git.o depend on common-cmds.h Makefile: fold XDIFF_H and VCSSVN_H into LIB_H Makefile: fold MISC_H into LIB_H Makefile: sort LIB_H list