aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* rev-list: fix process_tree() conversion.Linus Torvalds2006-06-05
| | | | | | | The tree-walking conversion of the "process_tree()" function broke packing by using an unrelated variable from outer scope. Signed-off-by: Junio C Hamano <junkio@cox.net>
* Fix typo in tutorial-2.txtLinus Torvalds2006-06-05
| | | | | | | | | | This should be obvious enough. I didn't actually _test_ the tutorial, but if the old command worked, something is really wrong! Signed-off-by: Linus "Duh!" Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Fix Documentation/everyday.txt: Junio's workflowHorst H. von Brand2006-06-05
| | | | | | | The workflow for Junio was badly formatted. Signed-off-by: Horst H. von Brand <vonbrand@inf.utfsm.cl> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Add example xinetd(8) configuration to Documentation/everyday.txtHorst H. von Brand2006-06-05
| | | | | | | | Many Linux distributions use xinetd(8), not inetd(8). Give a sample configuration file. Signed-off-by: Horst H. von Brand <vonbrand@inf.utfsm.cl> Signed-off-by: Junio C Hamano <junkio@cox.net>
* read-tree: fix eye-candy.Linus Torvalds2006-06-05
| | | | | | | | | | | Anton Blanchard spotted that watching checkout stage of a clone on a slow terminal takes ages because it forgot to clear the "once a second happened" flag, so instead of updates the percentage output for every file it checks out after the first second has passed. Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitview: Add some useful keybindings.Aneesh Kumar K.V2006-06-04
| | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
* Merge branch 'lt/tree-2'Junio C Hamano2006-06-03
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lt/tree-2: fetch.c: do not call process_tree() from process_tree(). tree_entry(): new tree-walking helper function adjust to the rebased series by Linus. Remove "tree->entries" tree-entry list from tree parser Switch "read_tree_recursive()" over to tree-walk functionality Make "tree_entry" have a SHA1 instead of a union of object pointers Add raw tree buffer info to "struct tree" Remove last vestiges of generic tree_entry_list Convert fetch.c: process_tree() to raw tree walker Convert "mark_tree_uninteresting()" to raw tree walker Remove unused "zeropad" entry from tree_list_entry fsck-objects: avoid unnecessary tree_entry_list usage Remove "tree->entries" tree-entry list from tree parser builtin-read-tree.c: avoid tree_entry_list in prime_cache_tree_rec() Switch "read_tree_recursive()" over to tree-walk functionality Make "tree_entry" have a SHA1 instead of a union of object pointers Make "struct tree" contain the pointer to the tree buffer
| * fetch.c: do not call process_tree() from process_tree().Junio C Hamano2006-06-02
| | | | | | | | | | | | | | | | | | | | | | This function reads a freshly fetched tree object, and schedules the objects pointed by it for further fetching, so doing lookup_tree() and process_tree() recursively from there does not make much sense. We need to use process() on it to make sure we fetch it first, and leave the recursive processing to later stages. Signed-off-by: Junio C Hamano <junkio@cox.net>
| * tree_entry(): new tree-walking helper functionLinus Torvalds2006-05-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a "tree_entry()" function that combines the common operation of doing a "tree_entry_extract()" + "update_tree_entry()". It also has a simplified calling convention, designed for simple loops that traverse over a whole tree: the arguments are pointers to the tree descriptor and a name_entry structure to fill in, and it returns a boolean "true" if there was an entry left to be gotten in the tree. This allows tree traversal with struct tree_desc desc; struct name_entry entry; desc.buf = tree->buffer; desc.size = tree->size; while (tree_entry(&desc, &entry) { ... use "entry.{path, sha1, mode, pathlen}" ... } which is not only shorter than writing it out in full, it's hopefully less error prone too. [ It's actually a tad faster too - we don't need to recalculate the entry pathlength in both extract and update, but need to do it only once. Also, some callers can avoid doing a "strlen()" on the result, since it's returned as part of the name_entry structure. However, by now we're talking just 1% speedup on "git-rev-list --objects --all", and we're definitely at the point where tree walking is no longer the issue any more. ] NOTE! Not everybody wants to use this new helper function, since some of the tree walkers very much on purpose do the descriptor update separately from the entry extraction. So the "extract + update" sequence still remains as the core sequence, this is just a simplified interface. We should probably add a silly two-line inline helper function for initializing the descriptor from the "struct tree" too, just to cut down on the noise from that common "desc" initializer. Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
| * Merge branch 'jc/lt-tree-n-cache-tree' into lt/tree-2Junio C Hamano2006-05-29
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * jc/lt-tree-n-cache-tree: adjust to the rebased series by Linus. Remove "tree->entries" tree-entry list from tree parser Switch "read_tree_recursive()" over to tree-walk functionality Make "tree_entry" have a SHA1 instead of a union of object pointers Add raw tree buffer info to "struct tree" This results as if an "ours" merge absorbed the previous "next" branch change into the 10-patch series, but it really is a result of an honest merge. nothing to commit
| | * adjust to the rebased series by Linus.Junio C Hamano2006-05-29
| | | | | | | | | | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
| | * Merge branch 'lt/tree' into jc/lt-tree-n-cache-treeJunio C Hamano2006-05-28
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lt/tree: (98 commits) Remove "tree->entries" tree-entry list from tree parser Switch "read_tree_recursive()" over to tree-walk functionality Make "tree_entry" have a SHA1 instead of a union of object pointers Add raw tree buffer info to "struct tree" Don't use "sscanf()" for tree mode scanning git-fetch: avoid using "case ... in (arm)" mailinfo: skip bogus UNIX From line inside body mailinfo: More carefully parse header lines in read_one_header_line() Allow in body headers beyond the in body header prefix. More accurately detect header lines in read_one_header_line In handle_body only read a line if we don't already have one. Refactor commit messge handling. Move B and Q decoding into check header. Make read_one_header_line return a flag not a length. Fix memory leak in "git rev-list --objects" gitview: Move the console error messages to message dialog gitview: Add key binding for F5. Let git-clone to pass --template=dir option to git-init-db. Make cvsexportcommit create parent directories as needed. Document current cvsexportcommit limitations. ... Conflicts: Makefile, builtin.h, git.c are trivially resolved. builtin-read-tree.c needed adjustment for the tree parser change.
| | | * Remove "tree->entries" tree-entry list from tree parserLinus Torvalds2006-05-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This finally removes the tree-entry list from "struct tree", since most of the users can just use the tree-walk infrastructure to walk the raw tree buffers instead of the tree-entry list. The tree-entry list is inefficient, and generates tons of small allocations for no good reason. The tree-walk infrastructure is generally no harder to use than following a linked list, and allows us to do most tree parsing in-place. Some programs still use the old tree-entry lists, and are a bit painful to convert without major surgery. For them we have a helper function that creates a temporary tree-entry list on demand. We can convert those too eventually, but with this they no longer affect any users who don't need the explicit lists. Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
| | | * Switch "read_tree_recursive()" over to tree-walk functionalityLinus Torvalds2006-05-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't use the tree_entry list, it really had no major reason not to just walk the raw tree instead. Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
| | | * Make "tree_entry" have a SHA1 instead of a union of object pointersLinus Torvalds2006-05-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is preparatory work for further cleanups, where we try to make tree_entry look more like the more efficient tree-walk descriptor. Instead of having a union of pointers to blob/tree/objects, this just makes "struct tree_entry" have the raw SHA1, and makes all the users use that instead (often that implies adding a "lookup_tree(..)" on the sha1, but sometimes the user just wanted the SHA1 in the first place, and it just avoids an unnecessary indirection). Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
| | | * Add raw tree buffer info to "struct tree"Linus Torvalds2006-05-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows us to avoid allocating information for names etc, because we can just use the information from the tree buffer directly. We still keep the old "tree_entry_list" in struct tree as well, so old users aren't affected, apart from the fact that the allocations are different (if you free a tree entry, you should no longer free the name allocation for it, since it's allocated as part of "tree->buffer") Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | | Remove last vestiges of generic tree_entry_listLinus Torvalds2006-05-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The old tree_entry_list is dead, long live the unified single tree parser. Yes, we now still have a compatibility function to create a bogus tree_entry_list in builtin-read-tree.c, but that is now entirely local to that very messy piece of code. I'd love to clean read-tree.c up too, but I'm too scared right now, so the best I can do is to just contain the damage, and try to make sure that no new users of the tree_entry_list sprout up by not having it as an exported interface any more. Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | | Convert fetch.c: process_tree() to raw tree walkerLinus Torvalds2006-05-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This leaves only the horrid code in builtin-read-tree.c using the old interface. Some day I will gather the strength to tackle that one too. Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | | Convert "mark_tree_uninteresting()" to raw tree walkerLinus Torvalds2006-05-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Not very many users to go.. Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | | Remove unused "zeropad" entry from tree_list_entryLinus Torvalds2006-05-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | That was a hack, only needed because 'git fsck-objects' didn't look at the raw tree format. Now that fsck traverses the tree itself, we can drop it. Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | | fsck-objects: avoid unnecessary tree_entry_list usageLinus Torvalds2006-05-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prime example of where the raw tree parser is easier for everybody. [jc: "Aieee" one-liner fix from the list applied. ] Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | | Remove "tree->entries" tree-entry list from tree parserLinus Torvalds2006-05-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead, just use the tree buffer directly, and use the tree-walk infrastructure to walk the buffers instead of the tree-entry list. The tree-entry list is inefficient, and generates tons of small allocations for no good reason. The tree-walk infrastructure is generally no harder to use than following a linked list, and allows us to do most tree parsing in-place. Some programs still use the old tree-entry lists, and are a bit painful to convert without major surgery. For them we have a helper function that creates a temporary tree-entry list on demand. Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | | builtin-read-tree.c: avoid tree_entry_list in prime_cache_tree_rec()Linus Torvalds2006-05-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Use the raw tree walker instead. Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | | Switch "read_tree_recursive()" over to tree-walk functionalityLinus Torvalds2006-05-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't use the tree_entry list any more. Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | | Make "tree_entry" have a SHA1 instead of a union of object pointersLinus Torvalds2006-05-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is preparatory work for further cleanups, where we try to make tree_entry look more like the more efficient tree-walk descriptor. Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | | Make "struct tree" contain the pointer to the tree bufferLinus Torvalds2006-05-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows us to avoid allocating information for names etc, because we can just use the information from the tree buffer directly. Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | | Merge branch 'sp/reflog'Junio C Hamano2006-06-03
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * sp/reflog: fetch.c: do not pass uninitialized lock to unlock_ref(). Test that git-branch -l works. Verify git-commit provides a reflog message. Enable ref log creation in git checkout -b. Create/delete branch ref logs. Include ref log detail in commit, reset, etc. Change order of -m option to update-ref. Correct force_write bug in refs.c Change 'master@noon' syntax to 'master@{noon}'. Log ref updates made by fetch. Force writing ref if it doesn't exist. Added logs/ directory to repository layout. General ref log reading improvements. Fix ref log parsing so it works properly. Support 'master@2 hours ago' syntax Log ref updates to logs/refs/<ref> Convert update-ref to use ref_lock API. Improve abstraction of ref lock/write.
| * | | | fetch.c: do not pass uninitialized lock to unlock_ref().Junio C Hamano2006-05-31
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | | | Test that git-branch -l works.Shawn Pearce2006-05-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the user supplies -l to git-branch when creating a new branch then the new branch's log should be created automatically and the branch creation should be logged in that log. Further if a branch is being deleted and it had a log then also verify that the log was deleted. Test git-checkout -b foo -l for creating a new branch foo with a log and checking out that branch. Fixed git-checkout -b foo -l as the branch variable name was incorrect in the script. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | | | Verify git-commit provides a reflog message.Shawn Pearce2006-05-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The reflog message from git-commit should include the first line of the commit message as supplied by the user. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | | | Merge branch 'master' into sp/reflogJunio C Hamano2006-05-24
| |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: (90 commits) fetch.c: remove an unused variable and dead code. Clean up sha1 file writing Builtin git-cat-file builtin format-patch: squelch content-type for 7-bit ASCII CMIT_FMT_EMAIL: Q-encode Subject: and display-name part of From: fields. add more informative error messages to git-mktag remove the artificial restriction tagsize < 8kb git-rebase: use canonical A..B syntax to format-patch git-format-patch: now built-in. fmt-patch: Support --attach fmt-patch: understand old <his> notation Teach fmt-patch about --keep-subject Teach fmt-patch about --numbered fmt-patch: implement -o <dir> fmt-patch: output file names to stdout Teach fmt-patch to write individual files. built-in tar-tree and remote tar-tree Builtin git-diff-files, git-diff-index, git-diff-stages, and git-diff-tree. Builtin git-show-branch. Builtin git-apply. ...
| * \ \ \ \ Merge part of 'js/fmt-patch' for RFC2822 dates into 'sp/reflog'Junio C Hamano2006-05-19
| |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | An earlier patch from Shawn Pearce dependes on a change that is only in "next". I do not want to make this series hostage to the yet-to-graduate js/fmt-patch branch, but let's try fixing it by merging the early parts of the branch to see what happens. Right now, 'sp/reflog' will not be in "next" for now, so I won't have to regret this -- if this merge causes problem down the road merging I can always rebuild the topic branch ;-).
| * | | | | | Enable ref log creation in git checkout -b.Shawn Pearce2006-05-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Switch git checkout -b to use git-update-ref rather than echo and a shell I/O redirection. This is more in line with typical GIT commands and allows -b to be logged according to the normal ref logging rules. Added -l option to allow users to create the ref log at the same time as creating a branch. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | | | | | Create/delete branch ref logs.Shawn Pearce2006-05-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When crating a new branch offer '-l' as a way for the user to quickly enable ref logging for the new branch. When deleting a branch also delete its ref log. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | | | | | Include ref log detail in commit, reset, etc.Shawn Pearce2006-05-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When updating a ref at the direction of the user include a reason why head was changed as part of the ref log (assuming it was enabled). Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | | | | | Change order of -m option to update-ref.Shawn Pearce2006-05-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The actual position doesn't matter but most people prefer to see options appear before the arguments. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | | | | | Correct force_write bug in refs.cShawn Pearce2006-05-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | My earlier attempt at forcing a write for non-existant refs worked; it forced a write for pretty much all refs. This corrects the condition to only force a write for refs which don't exist yet. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | | | | | Change 'master@noon' syntax to 'master@{noon}'.Shawn Pearce2006-05-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Its ambiguous to parse "master@2006-05-17 18:30:foo" when foo is meant as a file name and ":30" is meant as 30 minutes past 6 pm. Therefore all date specifications in a sha1 expression must now appear within brackets and the ':' splitter used for the path name in a sha1 expression ignores ':' appearing within brackets. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | | | | | Log ref updates made by fetch.Shawn Pearce2006-05-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a ref is changed by http-fetch, local-fetch or ssh-fetch record the change and the remote URL/name in the log for the ref. This requires loading the config file to check logAllRefUpdates. Also fixed a bug in the ref lock generation; the log file name was not being produced right due to a bad prefix length. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | | | | | Force writing ref if it doesn't exist.Shawn Pearce2006-05-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Normally we try to skip writing a ref if its value hasn't changed but in the special case that the ref doesn't exist but the new value is going to be 0{40} then force writing the ref anyway. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | | | | | Added logs/ directory to repository layout.Shawn Pearce2006-05-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | | | | | General ref log reading improvements.Shawn Pearce2006-05-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Corrected the log starting time displayed in the error message (as it was always showing the epoch due to a bad input to strtoul). Improved the log parser so we only scan backwards towards the '\n' from the end of the prior log; during this scan the last '>' is remembered to improve performance (rather than scanning forward to it). If the log record matched is the last log record in the file only use its new sha1 value if the date matches exactly; otherwise we leave the passed in sha1 alone as it already contains the current value of the ref. This way lookups of dates later than the log end to stick with the current ref value in case the ref was updated without logging. If it looks like someone changed the ref without logging it and we are going to return the sha1 which should have been valid during the missing period then warn the user that there might be log data missing and thus their query result may not be accurate. The check isn't perfect as its just based on comparing the old and new sha1 values between the two log records but its better than not checking at all. Implemented test cases based on git-rev-parse for most of the boundary conditions. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | | | | | Fix ref log parsing so it works properly.Shawn Pearce2006-05-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The log parser was only ever matching the last log record due to calling strtoul on "> 1136091609" rather than " 1136091609". Also once a match for '@' has been found after the name of the ref there is no point in looking for another '@' within the remaining text. Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | | | | | Support 'master@2 hours ago' syntaxShawn Pearce2006-05-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Extended sha1 expressions may now include date specifications which indicate a point in time within the local repository's history. If the ref indicated to the left of '@' has a log in $GIT_DIR/logs/<ref> then the value of the ref at the time indicated by the specification is obtained from the ref's log. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | | | | | Log ref updates to logs/refs/<ref>Shawn Pearce2006-05-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If config parameter core.logAllRefUpdates is true or the log file already exists then append a line to ".git/logs/refs/<ref>" whenever git-update-ref <ref> is executed. Each log line contains the following information: oldsha1 <SP> newsha1 <SP> committer <LF> where committer is the current user, date, time and timezone in the standard GIT ident format. If the caller is unable to append to the log file then git-update-ref will fail without updating <ref>. An optional message may be included in the log line with the -m flag. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | | | | | Convert update-ref to use ref_lock API.Shawn Pearce2006-05-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This conversion also adds the '-m' switch to update-ref allowing the caller to record why the ref is changing. At present this is merely copied down into the ref_lock API. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | | | | | Improve abstraction of ref lock/write.Shawn Pearce2006-05-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Created 'struct ref_lock' to contain the data necessary to perform a ref update. This change improves writing a ref as the file names are generated only once (rather than twice) and supports following symrefs (up to the maximum depth). Further the ref_lock structure provides room to extend the update API with ref logging. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | | | | | Merge branch 'ff/svnimport'Junio C Hamano2006-06-03
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * ff/svnimport: git-svnimport: Improved detection of merges.
| * | | | | | | git-svnimport: Improved detection of merges.Florian Forster2006-05-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The regexes detecting merges (while still relying on the commit messages, though) have been improved to catch saner (and hopefully more) messages. The old regex was so generic that it often matched something else and missed the actual merge-message. Also, the regex given with the `-M' commandline-option is checked first: Explicitely given regexes should be considered better than the builtin ones, and should therefore be given a chance to match a message first. Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | | | | | | read-tree --reset: update working tree file for conflicted paths.Junio C Hamano2006-06-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The earlier "git reset --hard" simplification stopped removing leftover working tree files from a failed automerge, when switching back to the HEAD version that does not have the paths. This patch, instead of removing the unmerged paths from the index, drops them down to stage#0 but marks them with mode=0 (the same "to be deleted" marker we internally use for paths deleted by the merge). one_way_merge() function and the functions it calls already know what to do with them -- if the tree we are reading has the path the working tree file is overwritten, and if it doesn't the working tree file is removed. Signed-off-by: Junio C Hamano <junkio@cox.net>