summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'ld/push-porcelain'Junio C Hamano2010-03-155-9/+67
|\ | | | | | | | | | | | | | | | | | | | | | | * ld/push-porcelain: t5516: Use test_cmp when appropriate git-push: add tests for git push --porcelain git-push: make git push --porcelain print "Done" git-push: send "To <remoteurl>" messages to the standard output in --porcelain mode git-push: fix an advice message so it goes to stderr Conflicts: transport.c
| * t5516: Use test_cmp when appropriateJunio C Hamano2010-03-111-3/+3
| | | | | | | | | | | | | | | | | | Consistently using test_cmp would make debugging test scripts far easier, as output from them run under "-v" option becomes readable. Besides, some platforms' "diff" implementations lack "-q" option. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * git-push: add tests for git push --porcelainLarry D'Anna2010-02-281-0/+50
| | | | | | | | | | | | | | | | Verify that the output format is correct for successful, rejected, and flagrantly erroneous pushes. Signed-off-by: Larry D'Anna <larry@elder-gods.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * git-push: make git push --porcelain print "Done"Larry D'Anna2010-02-283-5/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The script calling git push --porcelain --dry-run can see clearly from the output if an update was rejected. However, it will probably need to distinguish this condition from the push failing for other reasons, such as the remote not being reachable. This patch modifies git push --porcelain to print "Done" after the rest of its output unless any errors have occurred. For the purpose of the "Done" line, knowing a ref will be rejected in a --dry-run does not count as an error. Actual rejections in non --dry-run pushes do count as errors. Signed-off-by: Larry D'Anna <larry@elder-gods.org> Acked-by: Tay Ray Chuan <rctay89@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * git-push: send "To <remoteurl>" messages to the standard output in ↵Larry D'Anna2010-02-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | --porcelain mode git-push prints the line "To <remoteurl>" before above each of the ref status lines. In --porcelain mode, these "To <remoteurl>" lines go to the standard error, but the ref status lines go to the standard output. This makes it difficult for the process reading standard output to know which ref status lines correspond to which remote. This patch sends the "To <remoteurl>" lines to the the standard output instead. Signed-off-by: Larry D'Anna <larry@elder-gods.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * git-push: fix an advice message so it goes to stderrLarry D'Anna2010-02-281-3/+3
| | | | | | | | | | | | | | These sort of messages typically go to the standard error. Signed-off-by: Larry D'Anna <larry@elder-gods.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'jh/notes'Junio C Hamano2010-03-1514-196/+2167
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * jh/notes: (33 commits) Documentation: fix a few typos in git-notes.txt notes: fix malformed tree entry builtin-notes: Minor (mostly parse_options-related) fixes builtin-notes: Add "copy" subcommand for copying notes between objects builtin-notes: Misc. refactoring of argc and exit value handling builtin-notes: Add -c/-C options for reusing notes builtin-notes: Refactor handling of -F option to allow combining -m and -F builtin-notes: Deprecate the -m/-F options for "git notes edit" builtin-notes: Add "append" subcommand for appending to note objects builtin-notes: Add "add" subcommand for adding notes to objects builtin-notes: Add --message/--file aliases for -m/-F options builtin-notes: Add "list" subcommand for listing note objects Documentation: Generalize git-notes docs to 'objects' instead of 'commits' builtin-notes: Add "prune" subcommand for removing notes for missing objects Notes API: prune_notes(): Prune notes that belong to non-existing objects t3305: Verify that removing notes triggers automatic fanout consolidation builtin-notes: Add "remove" subcommand for removing existing notes Teach builtin-notes to remove empty notes Teach notes code to properly preserve non-notes in the notes tree t3305: Verify that adding many notes with git-notes triggers increased fanout ... Conflicts: Makefile
| * | Documentation: fix a few typos in git-notes.txtMichael J Gruber2010-03-041-2/+2
| | | | | | | | | | | | | | | | | | Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Acked-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | notes: fix malformed tree entryJunio C Hamano2010-02-241-2/+2
| | | | | | | | | | | | | | | | | | | | | The mode bits for entries in a tree object should be an octal number with minimum number of digits. Do not pad it with 0 to the left. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | builtin-notes: Minor (mostly parse_options-related) fixesJohan Herland2010-02-241-21/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use PARSE_OPT_NONEG to disallow --no-<option> for message, file, reedit-message and reuse-message. for which --no-<option> does not make sense. This also simplifies the code in the option-handling callbacks. Also, use strbuf_addch(... '\n') instead of strbuf_addstr(... "\n") in couple of places. Finally, improve the short-help by dividing the options into two OPT_GROUPs. Suggested-by: Stephen Boyd <bebarino@gmail.com> Signed-off-by: Johan Herland <johan@herland.net> Acked-by: Stephen Boyd <bebarino@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | builtin-notes: Add "copy" subcommand for copying notes between objectsJohan Herland2010-02-133-8/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is useful for keeping notes to objects that are being rewritten by e.g. 'git commit --amend', 'git rebase', or 'git cherry-pick'. "git notes copy <from> <to>" is in practice equivalent to "git notes add -C $(git notes list <from>) <to>", although it is somewhat more convenient for regular users. "git notes copy" takes the same -f option as "git add", to overwrite existing notes at the target (instead of aborting with an error message). If the <from>-object has no notes, "git notes copy" will abort with an error message. The patch includes tests verifying correct behaviour of the new subcommand. Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | builtin-notes: Misc. refactoring of argc and exit value handlingJohan Herland2010-02-131-25/+36
| | | | | | | | | | | | | | | | | | | | | This is in preparation of future patches that add additional subcommands. Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | builtin-notes: Add -c/-C options for reusing notesJohan Herland2010-02-133-12/+179
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Inspired by the -c/-C options to "git commit", we teach these options to "git notes add/append" to allow reuse of note objects. With this patch in place, it is now easy to copy or move notes between objects. For example, to copy object A's notes to object B: git notes add [-f] -C $(git notes list A) B To move instead of copying, you simply remove the notes from the source object afterwards, e.g.: git notes remove A The patch includes tests verifying correct behaviour of the new functionality. Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | builtin-notes: Refactor handling of -F option to allow combining -m and -FJohan Herland2010-02-132-44/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By moving the -F option handling into a separate function (parse_file_arg), we can start allowing several -F options, and mixed usage of -m and -F options. Each -m/-F given appends to the note message, in the order they are given on the command-line. The patch includes tests verifying correct behaviour of the new functionality. Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | builtin-notes: Deprecate the -m/-F options for "git notes edit"Johan Herland2010-02-135-8/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The semantics for "git notes edit -m/-F" overlap with those for "git notes add -f", and the behaviour (i.e. overwriting existing notes with the given message/file) is more intuitively captured by (and better documented with) "git notes add -f". Suggested-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | builtin-notes: Add "append" subcommand for appending to note objectsJohan Herland2010-02-133-9/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "git notes append" is equivalent to "git notes edit" except that instead of editing existing notes contents, you can only append to it. This is useful for quickly adding annotations like e.g.: git notes append -m "Acked-by: A U Thor <author@example.com>" "git notes append" takes the same -m/-F options as "git notes add". If there is no existing note to append to, "git notes append" is identical to "git notes add" (i.e. it adds a new note). The patch includes tests verifying correct behaviour of the new subcommand. Suggested-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | builtin-notes: Add "add" subcommand for adding notes to objectsJohan Herland2010-02-133-22/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "git notes add" is identical to "git notes edit" except that instead of editing existing notes for a given object, you can only add notes to an object that currently has none. If "git notes add" finds existing notes for the given object, the addition is aborted. However, if the new -f/--force option is used, "git notes add" will _overwrite_ the existing notes with the new notes contents. If there is no existing notes for the given object. "git notes add" is identical to "git notes edit" (i.e. it adds a new note). The patch includes tests verifying correct behaviour of the new subcommand. Suggested-by: Joey Hess <joey@kitenet.net> Improved-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | builtin-notes: Add --message/--file aliases for -m/-F optionsJohan Herland2010-02-132-2/+4
| | | | | | | | | | | | | | | Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | builtin-notes: Add "list" subcommand for listing note objectsJohan Herland2010-02-133-6/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "git notes list" will list all note objects in the current notes ref (in the format "<note object> <annotated object>"). "git notes list <object>" will list the note object associated with the given <object>, or fail loudly if the given <object> has no associated notes. If no arguments are given to "git notes", it defaults to the "list" subcommand. This is for pseudo-compatibility with "git tag" and "git branch". The patch includes tests verifying correct behaviour of the new subcommand. Suggested-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | Documentation: Generalize git-notes docs to 'objects' instead of 'commits'Johan Herland2010-02-131-15/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Notes can annotate arbitrary objects (not only commits), but this is not reflected in the current documentation. This patch rewrites the git-notes documentation to talk about 'objects' instead of 'commits'. However, the discussion on commit notes and how they are displayed by 'git log' is largely preserved. Finally, I add myself to the Author/Documentation credits, since most of the lines in the git-notes code and docs are blamed on me. Cc: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | builtin-notes: Add "prune" subcommand for removing notes for missing objectsJohan Herland2010-02-133-11/+115
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "git notes prune" will remove all notes that annotate unreachable/non- existing objects. The patch includes tests verifying correct behaviour of the new subcommand. Suggested-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | Notes API: prune_notes(): Prune notes that belong to non-existing objectsJohan Herland2010-02-132-0/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When an object is made unreachable by Git, any notes that annotate that object are not automagically made unreachable, since all notes are always trivially reachable from a notes ref. In order to remove notes for non-existing objects, we therefore need to add functionality for traversing the notes tree and explicitly removing references to notes that annotate non-reachable objects. Thus the notes objects themselves also become unreachable, and are removed by a later garbage collect. prune_notes() performs this traversal (by using for_each_note() internally), and removes the notes in question from the notes tree. Note that the effect of prune_notes() is not persistent unless a subsequent call to write_notes_tree() is made. Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | t3305: Verify that removing notes triggers automatic fanout consolidationJohan Herland2010-02-131-1/+46
| | | | | | | | | | | | | | | Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | builtin-notes: Add "remove" subcommand for removing existing notesJohan Herland2010-02-133-34/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | Using "git notes remove" is equivalent to specifying an empty note message. The patch includes tests verifying correct behaviour of the new subcommand. Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | Teach builtin-notes to remove empty notesJohan Herland2010-02-132-4/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the result of editing a note is an empty string, the associated note entry should be deleted from the notes tree. This allows deleting notes by invoking either "git notes -m ''" or "git notes -F /dev/null". Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | Teach notes code to properly preserve non-notes in the notes treeJohan Herland2010-02-134-51/+233
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The note tree structure allows for non-note entries to coexist with note entries in a notes tree. Although we certainly expect there to be very few non-notes in a notes tree, we should still support them to a certain degree. This patch teaches the notes code to preserve non-notes when updating the notes tree with write_notes_tree(). Non-notes are not affected by fanout restructuring. For non-notes to be handled correctly, we can no longer allow subtree entries that do not match the fanout structure produced by the notes code itself. This means that fanouts like 4/36, 6/34, 8/32, 4/4/32, etc. are no longer recognized as note subtrees; only 2-based fanouts are allowed (2/38, 2/2/36, 2/2/2/34, etc.). Since the notes code has never at any point _produced_ non-2-based fanouts, it is highly unlikely that this change will cause problems for anyone. The patch also adds some tests verifying the correct handling of non-notes in a notes tree. Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | t3305: Verify that adding many notes with git-notes triggers increased fanoutJohan Herland2010-02-131-0/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add a test verifying that the notes code automatically restructures the notes tree into a deeper fanout level, when many notes are added with "git notes". Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | t3301: Verify successful annotation of non-commitsJohan Herland2010-02-131-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | Adds a testcase verifying that git-notes works successfully on tree, blob, and tag objects. Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | Builtin-ify git-notesJohan Herland2010-02-137-40/+350
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The builtin-ification includes some minor behavioural changes to the command-line interface: It is no longer allowed to mix the -m and -F arguments, and it is not allowed to use multiple -F options. As part of the builtin-ification, we add the commit_notes() function to the builtin API. This function (together with the notes.h API) can be easily used from other builtins to manipulate the notes tree. Also includes needed changes to t3301. This patch has been improved by the following contributions: - Stephen Boyd: Use die() instead of fprintf(stderr, ...) followed by exit(1) Cc: Stephen Boyd <bebarino@gmail.com> Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | Refactor notes concatenation into a flexible interface for combining notesJohan Herland2010-02-132-60/+112
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When adding a note to an object that already has an existing note, the current solution is to concatenate the contents of the two notes. However, the caller may instead wish to _overwrite_ the existing note with the new note, or maybe even _ignore_ the new note, and keep the existing one. There might also be other ways of combining notes that are only known to the caller. Therefore, instead of unconditionally concatenating notes, we let the caller specify how to combine notes, by passing in a pointer to a function for combining notes. The caller may choose to implement its own function for notes combining, but normally one of the following three conveniently supplied notes combination functions will be sufficient: - combine_notes_concatenate() combines the two notes by appending the contents of the new note to the contents of the existing note. - combine_notes_overwrite() replaces the existing note with the new note. - combine_notes_ignore() keeps the existing note, and ignores the new note. A combine_notes function can be passed to init_notes() to choose a default combine_notes function for that notes tree. If NULL is given, the notes tree falls back to combine_notes_concatenate() as the ultimate default. A combine_notes function can also be passed directly to add_note(), to control the notes combining behaviour for a note addition in particular. If NULL is passed, the combine_notes function registered for the given notes tree is used. Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | Notes API: Allow multiple concurrent notes trees with new struct notes_treeJohan Herland2010-02-133-66/+112
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new struct notes_tree encapsulates access to a specific notes tree. It is provided to allow callers to make use of several different notes trees simultaneously. A struct notes_tree * parameter is added to every function in the notes API. In all cases, NULL can be passed, in which case the fallback "default" notes tree (default_notes_tree) is used. Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | Notes API: write_notes_tree(): Store the notes tree in the databaseJohan Herland2010-02-132-3/+180
| | | | | | | | | | | | | | | | | | | | | | | | | | | Uses for_each_note() to traverse the notes tree, and produces tree objects on the fly representing the "on-disk" version of the notes tree with appropriate fanout. Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | Notes API: for_each_note(): Traverse the entire notes tree with a callbackJohan Herland2010-02-132-0/+180
| | | | | | | | | | | | | | | | | | | | | | | | This includes a first attempt at creating an optimal fanout scheme (which is calculated on-the-fly, while traversing). Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | Notes API: get_note(): Return the note annotating the given objectJohan Herland2010-02-132-7/+15
| | | | | | | | | | | | | | | | | | | | | Created by a simple cleanup and rename of lookup_notes(). Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | Notes API: remove_note(): Remove note objects from the notes tree structureJohan Herland2010-02-132-1/+87
| | | | | | | | | | | | | | | | | | | | | | | | This includes adding internal functions for maintaining a healthy notes tree structure after removing individual notes. Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | Notes API: add_note(): Add note objects to the internal notes tree structureJohan Herland2010-02-132-0/+15
| | | | | | | | | | | | | | | Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | Notes API: init_notes(): Initialize the notes tree from the given notes refJohan Herland2010-02-132-12/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Created by a simple refactoring of initialize_notes(). Also add a new 'flags' parameter, which is a bitwise combination of notes initialization flags. For now, there is only one flag - NOTES_INIT_EMPTY - which indicates that the notes tree should not auto-load the contents of the given (or default) notes ref, but rather should leave the notes tree initialized to an empty state. This will become useful in the future when manipulating the notes tree through the notes API. Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | Add tests for checking correct handling of $GIT_NOTES_REF and core.notesRefJohan Herland2010-02-131-0/+48
| | | | | | | | | | | | | | | Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | Notes API: get_commit_notes() -> format_note() + remove the commit restrictionJohan Herland2010-02-133-22/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is really no reason why only commit objects can be annotated. By changing the struct commit parameter to get_commit_notes() into a sha1 we gain the ability to annotate any object type. To reflect this in the function naming as well, we rename get_commit_notes() to format_note(). This patch also fixes comments and variable names throughout notes.c as a consequence of the removal of the unnecessary 'commit' restriction. Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | Minor cosmetic fixes to notes.cJohan Herland2010-02-131-5/+4
| | | | | | | | | | | | | | | Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Merge branch 'maint'Junio C Hamano2010-03-136-14/+47
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | * maint: don't use default revision if a rev was specified for_each_recent_reflog_ent(): use strbuf, fix offset handling t/Makefile: remove test artifacts upon "make clean" blame: fix indent of line numbers
| * | | don't use default revision if a rev was specifiedDave Olszewski2010-03-132-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a revision is specified, it happens not to have any commits, don't use the default revision. By doing so, surprising and undesired behavior can happen, such as showing the reflog for HEAD when a branch was specified. [jc: squashed a test from René] Signed-off-by: Dave Olszewski <cxreg@pobox.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | for_each_recent_reflog_ent(): use strbuf, fix offset handlingRené Scharfe2010-03-131-10/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As Vladimir reported, "git log -g refs/stash" surprisingly showed the reflog of HEAD if the message in the reflog file was too long. To fix this, convert for_each_recent_reflog_ent() to use strbuf_getwholeline() instead of fgets(), for safety and to avoid any size limits for reflog entries. Also reverse the logic of the part of the function that only looks at file tails. It used to close the file if fgets() succeeded. The following fgets() call in the while loop was likely to fail in this case, too, so passing an offset to for_each_recent_reflog_ent() never worked. Change it to error out if strbuf_getwholeline() fails instead. Reported-by: Vladimir Panteleev <vladimir@thecybershadow.net> Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | t/Makefile: remove test artifacts upon "make clean"Junio C Hamano2010-03-131-0/+2
| | | | | | | | | | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | blame: fix indent of line numbersRené Scharfe2010-03-132-2/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Correct the calculation of the number of digits for line counts of the form 10^n-1 (9, 99, ...) in lineno_width(). This makes blame stop printing an extra space before the line numbers of files with that many total lines. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | Merge git://git.bogomips.org/git-svnJunio C Hamano2010-03-133-2/+4
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | * git://git.bogomips.org/git-svn: t9150,t9151: Add rewrite-root option to init git-svn: Fix merge detecting with rewrite-root
| * | | | t9150,t9151: Add rewrite-root option to initTuomas Suutari2010-03-132-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The rewrite-root option seems to be a bit problematic with merge detecting, so it's better to have a merge detecting test with it turned on. Signed-off-by: Tuomas Suutari <tuomas.suutari@gmail.com> Acked-by: Eric Wong <normalperson@yhbt.net>
| * | | | git-svn: Fix merge detecting with rewrite-rootTuomas Suutari2010-03-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Detecting of merges from svn:mergeinfo or svk merge tickets failed with rewrite-root option. This fixes it. Signed-off-by: Tuomas Suutari <tuomas.suutari@gmail.com> Acked-by: Eric Wong <normalperson@yhbt.net>
* | | | | Merge branch 'maint'Junio C Hamano2010-03-121-12/+12
|\ \ \ \ \ | |/ / / / |/| / / / | |/ / / | | | | * maint: t9400: Use test_cmp when appropriate
| * | | t9400: Use test_cmp when appropriateJunio C Hamano2010-03-111-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Consistently using test_cmp would make debugging test scripts far easier, as output from them run under "-v" option becomes readable. Besides, some platforms' "diff" implementations lack "-q" option. Signed-off-by: Junio C Hamano <gitster@pobox.com>