{"thread":{"id":"43600","subject":"What's in git.git (stable)","startedAt":"2006-12-18T07:26:18Z","lastAt":"2006-12-18T22:04:38Z","messageCount":2,"participants":["Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"295801","messageId":"7v64c93bs5.fsf@assigned-by-dhcp.cox.net","threadId":"43600","inReplyTo":null,"subject":"What's in git.git (stable)","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-12-18T07:26:18Z","receivedAt":"2006-12-18T07:26:18Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"I've updated 'master' with a handful topics along with a few\nfixes:\n\n - Jakub's gitweb updates;\n\n - blame A..B's output shows lines attributed to the boundary\n   commit with commit SHA-1 prefixed with '^';\n\n - \"branch -m $old $new\" renames branch.$old.* configuration\n   variables to branch.$new.*;\n\n - \"git add A/B C\", when A and C/D used to be tracked files, now\n   properly works, it used to result in a bogus index you cannot\n   write-tree out;\n\n - \"git show-branch --reflog=<n> <branch>\" shows latest n entries\n   of the reflog of the branch.\n\n - \"git fetch\" between repositories with tons of refs had huge\n   performance problem; hopefully fixed.\n\n* The 'master' branch has these since the last announcement.\n\n   Jakub Narebski (8):\n      gitweb: Don't use Content-Encoding: header in git_snapshot\n      gitweb: Show target of symbolic link in \"tree\" view\n      gitweb: Add generic git_object subroutine to display object of any type\n      gitweb: Hyperlink target of symbolic link in \"tree\" view (if possible)\n      gitweb: SHA-1 in commit log message links to \"object\" view\n      gitweb: Do not show difftree for merges in \"commit\" view\n      gitweb: Add title attribute to ref marker with full ref name\n      gitweb: Add \"next\" link to commit view\n\n   Johannes Schindelin (2):\n      add a function to rename sections in the config\n      git-branch: rename config vars branch.<branch>.*, too\n\n   Junio C Hamano (11):\n      git-blame: show lines attributed to boundary commits differently.\n      update-index: make D/F conflict error a bit more verbose.\n      git-add: remove conflicting entry when adding.\n      Fix check_file_directory_conflict().\n      Fix mis-mark-up in git-merge-file.txt documentation\n      markup fix in svnimport documentation.\n      Teach show-branch how to show ref-log data.\n      git-fetch: Avoid reading packed refs over and over again\n      avoid accessing _all_ loose refs in git-show-ref --verify\n      show-ref: fix --quiet --verify\n      show-ref: fix --verify --hash=length\n\n   Quy Tonthat (1):\n      Documentation: new option -P for git-svnimport\n\n   Shawn Pearce (1):\n      Default GIT_COMMITTER_NAME to login name in recieve-pack.\n"},{"id":"298344","messageId":"7vzm9kvp1l.fsf@assigned-by-dhcp.cox.net","threadId":"43600","inReplyTo":"Pine.LNX.4.64.0612181012280.3479@woody.osdl.org","subject":"Re: What's in git.git (stable)","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-12-18T22:04:38Z","receivedAt":"2006-12-18T22:04:38Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Linus Torvalds <torvalds@osdl.org> writes:\n\n> On Sun, 17 Dec 2006, Junio C Hamano wrote:\n>> \n>>  - blame A..B's output shows lines attributed to the boundary\n>>    commit with commit SHA-1 prefixed with '^';\n>\n> I wonder if it would make sense to have a flag or mode or something where \n> boundary commit attributions are simply left unattributed (ie just leave \n> that _empty_).\n\nHow about this?\n\n-- >8 --\nblame: -b (blame.blankboundary) and --root (blame.showroot)\n\nWhen blame.blankboundary is set (or -b option is given), commit\nobject names are blanked out in the \"human readable\" output\nformat for boundary commits.\n\nWhen blame.showroot is not set (or --root is not given), the\nroot commits are treated as boundary commits.  The code still\nattributes the lines to them, but with -b their object names are\nnot shown.\n\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n\n---\n builtin-blame.c |   33 +++++++++++++++++++++++++++++++--\n 1 files changed, 31 insertions(+), 2 deletions(-)\n\ndiff --git a/builtin-blame.c b/builtin-blame.c\nindex a250724..211bdb3 100644\n--- a/builtin-blame.c\n+++ b/builtin-blame.c\n@@ -22,7 +22,9 @@\n static char blame_usage[] =\n \"git-blame [-c] [-l] [-t] [-f] [-n] [-p] [-L n,m] [-S <revs-file>] [-M] [-C] [-C] [commit] [--] file\\n\"\n \"  -c, --compatibility Use the same output mode as git-annotate (Default: off)\\n\"\n+\"  -b                  Show blank SHA-1 for boundary commits (Default: off)\\n\"\n \"  -l, --long          Show long commit SHA1 (Default: off)\\n\"\n+\"  --root              Do not treat root commits as boundaries (Default: off)\\n\"\n \"  -t, --time          Show raw timestamp (Default: off)\\n\"\n \"  -f, --show-name     Show original filename (Default: auto)\\n\"\n \"  -n, --show-number   Show original linenumber (Default: off)\\n\"\n@@ -36,6 +38,8 @@ static int longest_author;\n static int max_orig_digits;\n static int max_digits;\n static int max_score_digits;\n+static int show_root;\n+static int blank_boundary;\n \n #ifndef DEBUG\n #define DEBUG 0\n@@ -1095,6 +1099,9 @@ static void assign_blame(struct scoreboard *sb, struct rev_info *revs, int opt)\n \t\t\tif (commit->object.parsed)\n \t\t\t\tmark_parents_uninteresting(commit);\n \t\t}\n+\t\t/* treat root commit as boundary */\n+\t\tif (!commit->parents && !show_root)\n+\t\t\tcommit->object.flags |= UNINTERESTING;\n \n \t\t/* Take responsibility for the remaining entries */\n \t\tfor (ent = sb->ent; ent; ent = ent->next)\n@@ -1318,8 +1325,12 @@ static void emit_other(struct scoreboard *sb, struct blame_entry *ent, int opt)\n \t\tint length = (opt & OUTPUT_LONG_OBJECT_NAME) ? 40 : 8;\n \n \t\tif (suspect->commit->object.flags & UNINTERESTING) {\n-\t\t\tlength--;\n-\t\t\tputchar('^');\n+\t\t\tif (!blank_boundary) {\n+\t\t\t\tlength--;\n+\t\t\t\tputchar('^');\n+\t\t\t}\n+\t\t\telse\n+\t\t\t\tmemset(hex, ' ', length);\n \t\t}\n \n \t\tprintf(\"%.*s\", length, hex);\n@@ -1639,6 +1650,19 @@ static void prepare_blame_range(struct scoreboard *sb,\n \t\tusage(blame_usage);\n }\n \n+static int git_blame_config(const char *var, const char *value)\n+{\n+\tif (!strcmp(var, \"blame.showroot\")) {\n+\t\tshow_root = git_config_bool(var, value);\n+\t\treturn 0;\n+\t}\n+\tif (!strcmp(var, \"blame.blankboundary\")) {\n+\t\tblank_boundary = git_config_bool(var, value);\n+\t\treturn 0;\n+\t}\n+\treturn git_default_config(var, value);\n+}\n+\n int cmd_blame(int argc, const char **argv, const char *prefix)\n {\n \tstruct rev_info revs;\n@@ -1654,6 +1678,7 @@ int cmd_blame(int argc, const char **argv, const char *prefix)\n \tchar type[10];\n \tconst char *bottomtop = NULL;\n \n+\tgit_config(git_blame_config);\n \tsave_commit_buffer = 0;\n \n \topt = 0;\n@@ -1662,6 +1687,10 @@ int cmd_blame(int argc, const char **argv, const char *prefix)\n \t\tconst char *arg = argv[i];\n \t\tif (*arg != '-')\n \t\t\tbreak;\n+\t\telse if (!strcmp(\"-b\", arg))\n+\t\t\tblank_boundary = 1;\n+\t\telse if (!strcmp(\"--root\", arg))\n+\t\t\tshow_root = 1;\n \t\telse if (!strcmp(\"-c\", arg))\n \t\t\toutput_option |= OUTPUT_ANNOTATE_COMPAT;\n \t\telse if (!strcmp(\"-t\", arg))\n"}]}