{"thread":{"id":"23690","subject":"[PATCH] blame: can specify shas of commits to ignore on command line","startedAt":"2010-05-04T02:21:27Z","lastAt":"2012-03-08T21:01:13Z","messageCount":8,"participants":["Dylan Reid","René Scharfe","Junio C Hamano","cnighswonger"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"140874","messageId":"1272939687-17686-1-git-send-email-dgreid@gmail.com","threadId":"23690","inReplyTo":null,"subject":"[PATCH] blame: can specify shas of commits to ignore on command line","fromName":"Dylan Reid","fromEmail":"dgreid@gmail.com","sentAt":"2010-05-04T02:21:27Z","receivedAt":"2010-05-04T02:21:27Z","isPatch":true,"sender":{"key":"dgreid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/113378?v=4"},"body":"Add the ability for git-blame to ignore changes that occur in\ncertain commits.  The new \"-I <sha>\" argument can be used to specify\na commit that should be ignored.  This is useful if you have a\nfew commits that you know didn't cause a problem, for example you\nswitched from \"u8\" to \"uint8_t\" and it messed up your history.\n\n   Allow multiple commits to be specified and store an array in the\nscoreboard structure so it is accessible.  Add should_ignore_commit\nfunction to check if a commit should be ignored. Call\n\"should_ignore_commit\" from blame_overlap and if the commit should\nbe ignored then pass all the blame on to the parent of the ignored\ncommit.  This is done by calling \"pass_whole_blame\" which has been\nrelocated to a above blame_overlap, but is unchanged.\n\nSigned-off-by: Dylan Reid <dgreid@gmail.com>\n---\n Documentation/blame-options.txt |    6 ++\n builtin/blame.c                 |  124 +++++++++++++++++++++++++++++----------\n t/t8003-blame.sh                |   42 +++++++++++++\n 3 files changed, 141 insertions(+), 31 deletions(-)\n\ndiff --git a/Documentation/blame-options.txt b/Documentation/blame-options.txt\nindex d820569..eb9c825 100644\n--- a/Documentation/blame-options.txt\n+++ b/Documentation/blame-options.txt\n@@ -52,6 +52,12 @@ of lines before or after the line given by <start>.\n --porcelain::\n \tShow in a format designed for machine consumption.\n \n+--ignore-commit <sha>::\n+\tIgnore the specified commit when assigning blame.  This is\n+\tuseful if there are commits in the history that make non\n+\tfunctional changes to the lines you are interested in\n+\tfinding blame for.\n+\n --incremental::\n \tShow the result incrementally in a format designed for\n \tmachine consumption.\ndiff --git a/builtin/blame.c b/builtin/blame.c\nindex fc15863..e4bd095 100644\n--- a/builtin/blame.c\n+++ b/builtin/blame.c\n@@ -176,6 +176,14 @@ struct blame_entry {\n };\n \n /*\n+ * List of any commits to ignore\n+ */\n+struct ignore_commits {\n+\tunsigned char (*ignore_shas)[20];\n+\tunsigned num_ignore_shas;\n+};\n+\n+/*\n  * The current state of the blame assignment.\n  */\n struct scoreboard {\n@@ -198,6 +206,9 @@ struct scoreboard {\n \t/* look-up a line in the final buffer */\n \tint num_lines;\n \tint *lineno;\n+\n+\t/* List of the shas of commits that should be ignored */\n+\tstruct ignore_commits *ignored_commits;\n };\n \n static inline int same_suspect(struct origin *a, struct origin *b)\n@@ -653,6 +664,44 @@ static void decref_split(struct blame_entry *split)\n }\n \n /*\n+ * The blobs of origin and porigin exactly match, so everything\n+ * origin is suspected for can be blamed on the parent.\n+ */\n+static void pass_whole_blame(struct scoreboard *sb,\n+\t\t\t     struct origin *origin, struct origin *porigin)\n+{\n+   struct blame_entry *e;\n+\n+   if (!porigin->file.ptr && origin->file.ptr) {\n+      /* Steal its file */\n+      porigin->file = origin->file;\n+      origin->file.ptr = NULL;\n+   }\n+   for (e = sb->ent; e; e = e->next) {\n+      if (!same_suspect(e->suspect, origin))\n+\t continue;\n+      origin_incref(porigin);\n+      origin_decref(e->suspect);\n+      e->suspect = porigin;\n+   }\n+}\n+\n+/*\n+ * Helper to determine if the given commit should be ignored\n+ */\n+static unsigned should_ignore_commit(const struct scoreboard *sb,\n+\t\t\t\t     struct commit *commit)\n+{\n+\tunsigned i;\n+\tunsigned num_shas = sb->ignored_commits->num_ignore_shas;\n+\tfor(i = 0; i < num_shas; i++)\n+\t\tif(!hashcmp(commit->object.sha1,\n+\t\t\t    sb->ignored_commits->ignore_shas[i]))\n+\t\t\treturn 1;\n+\treturn 0;\n+}\n+\n+/*\n  * Helper for blame_chunk().  blame_entry e is known to overlap with\n  * the patch hunk; split it and pass blame to the parent.\n  */\n@@ -660,12 +709,15 @@ static void blame_overlap(struct scoreboard *sb, struct blame_entry *e,\n \t\t\t  int tlno, int plno, int same,\n \t\t\t  struct origin *parent)\n {\n-\tstruct blame_entry split[3];\n-\n-\tsplit_overlap(split, e, tlno, plno, same, parent);\n-\tif (split[1].suspect)\n-\t\tsplit_blame(sb, split, e);\n-\tdecref_split(split);\n+\tif(should_ignore_commit(sb, e->suspect->commit))\n+\t\tpass_whole_blame(sb, e->suspect, parent);\n+\telse {\n+\t\tstruct blame_entry split[3];\n+\t\tsplit_overlap(split, e, tlno, plno, same, parent);\n+\t\tif (split[1].suspect)\n+\t\t\tsplit_blame(sb, split, e);\n+\t\tdecref_split(split);\n+\t}\n }\n \n /*\n@@ -1105,29 +1157,6 @@ static int find_copy_in_parent(struct scoreboard *sb,\n }\n \n /*\n- * The blobs of origin and porigin exactly match, so everything\n- * origin is suspected for can be blamed on the parent.\n- */\n-static void pass_whole_blame(struct scoreboard *sb,\n-\t\t\t     struct origin *origin, struct origin *porigin)\n-{\n-\tstruct blame_entry *e;\n-\n-\tif (!porigin->file.ptr && origin->file.ptr) {\n-\t\t/* Steal its file */\n-\t\tporigin->file = origin->file;\n-\t\torigin->file.ptr = NULL;\n-\t}\n-\tfor (e = sb->ent; e; e = e->next) {\n-\t\tif (!same_suspect(e->suspect, origin))\n-\t\t\tcontinue;\n-\t\torigin_incref(porigin);\n-\t\torigin_decref(e->suspect);\n-\t\te->suspect = porigin;\n-\t}\n-}\n-\n-/*\n  * We pass blame from the current commit to its parents.  We keep saying\n  * \"parent\" (and \"porigin\"), but what we mean is to find scapegoat to\n  * exonerate ourselves.\n@@ -1540,8 +1569,14 @@ static void assign_blame(struct scoreboard *sb, int opt)\n \n \t\t/* Take responsibility for the remaining entries */\n \t\tfor (ent = sb->ent; ent; ent = ent->next)\n-\t\t\tif (same_suspect(ent->suspect, suspect))\n-\t\t\t\tfound_guilty_entry(ent);\n+\t\t\tif (same_suspect(ent->suspect, suspect)) {\n+\t\t\t\tif (should_ignore_commit(sb, commit) &&\n+\t\t\t\t    ent->suspect->previous)\n+\t\t\t\t\tpass_whole_blame(sb, ent->suspect,\n+\t\t\t\t\t\t\t ent->suspect->previous);\n+\t\t\t\telse\n+\t\t\t\t\tfound_guilty_entry(ent);\n+\t\t   }\n \t\torigin_decref(suspect);\n \n \t\tif (DEBUG) /* sanity */\n@@ -2204,6 +2239,24 @@ static int blame_bottomtop_callback(const struct option *option, const char *arg\n \treturn 0;\n }\n \n+static int blame_ignorecommit_callback(const struct option *option,\n+\t\t\t\t       const char *arg, int unset)\n+{\n+\tstruct ignore_commits *commits = option->value;\n+\tif (!arg)\n+\t\treturn -1;\n+\tcommits->ignore_shas =\n+\t\trealloc(commits->ignore_shas,\n+\t\t\t( (commits->num_ignore_shas + 1) *\n+\t\t\t  20 ));\n+\tif(!get_sha1(arg, commits->ignore_shas[commits->num_ignore_shas]))\n+\t\tcommits->num_ignore_shas++;\n+\telse\n+\t\treturn -1;\n+\n+\treturn 0;\n+}\n+\n int cmd_blame(int argc, const char **argv, const char *prefix)\n {\n \tstruct rev_info revs;\n@@ -2215,6 +2268,7 @@ int cmd_blame(int argc, const char **argv, const char *prefix)\n \tconst char *final_commit_name = NULL;\n \tenum object_type type;\n \n+\tstatic struct ignore_commits ignored_commits;\n \tstatic const char *bottomtop = NULL;\n \tstatic int output_option = 0, opt = 0;\n \tstatic int show_stats = 0;\n@@ -2239,6 +2293,7 @@ int cmd_blame(int argc, const char **argv, const char *prefix)\n \t\t{ OPTION_CALLBACK, 'C', NULL, &opt, \"score\", \"Find line copies within and across files\", PARSE_OPT_OPTARG, blame_copy_callback },\n \t\t{ OPTION_CALLBACK, 'M', NULL, &opt, \"score\", \"Find line movements within and across files\", PARSE_OPT_OPTARG, blame_move_callback },\n \t\tOPT_CALLBACK('L', NULL, &bottomtop, \"n,m\", \"Process only line range n,m, counting from 1\", blame_bottomtop_callback),\n+\t\tOPT_CALLBACK(0, \"ignore-commit\", &ignored_commits, \"sha\", \"don't blame the specified commit for anything\", blame_ignorecommit_callback),\n \t\tOPT_END()\n \t};\n \n@@ -2252,6 +2307,8 @@ int cmd_blame(int argc, const char **argv, const char *prefix)\n \tsave_commit_buffer = 0;\n \tdashdash_pos = 0;\n \n+\tmemset(&ignored_commits, 0, sizeof(ignored_commits));\n+\n \tparse_options_start(&ctx, argc, argv, prefix, PARSE_OPT_KEEP_DASHDASH |\n \t\t\t    PARSE_OPT_KEEP_ARGV0);\n \tfor (;;) {\n@@ -2369,6 +2426,8 @@ parse_done:\n \tsetup_revisions(argc, argv, &revs, NULL);\n \tmemset(&sb, 0, sizeof(sb));\n \n+\tsb.ignored_commits = &ignored_commits;\n+\n \tsb.revs = &revs;\n \tif (!reverse)\n \t\tfinal_commit_name = prepare_final(&sb);\n@@ -2468,6 +2527,9 @@ parse_done:\n \t\tent = e;\n \t}\n \n+\tif (ignored_commits.ignore_shas)\n+\t\tfree(ignored_commits.ignore_shas);\n+\n \tif (show_stats) {\n \t\tprintf(\"num read blob: %d\\n\", num_read_blob);\n \t\tprintf(\"num get patch: %d\\n\", num_get_patch);\ndiff --git a/t/t8003-blame.sh b/t/t8003-blame.sh\nindex 230143c..f90d37a 100755\n--- a/t/t8003-blame.sh\n+++ b/t/t8003-blame.sh\n@@ -185,4 +185,46 @@ test_expect_success 'indent of line numbers, ten lines' '\n \ttest $(grep -c \"  \" actual) = 9\n '\n \n+test_expect_success 'blame ignore setup with split' '\n+\techo A A A >one\n+\techo b b b b b >> one\n+\techo c c c c c >> one\n+\tgit add one\n+\tGIT_AUTHOR_NAME=AddLine git commit -m \"add As\"\n+\tINIT_ADD_SHA=`git log --pretty=format:\"%H\" HEAD^..`\n+\techo \" \" A A A >one\n+\techo b b b b b >> one\n+\techo c c c c c >> one\n+\tgit add one\n+\tGIT_AUTHOR_NAME=Indent git commit -m \"reindent\"\n+\tIGNORE_SHA=`git log --pretty=format:\"%H\" HEAD^..`\n+'\n+\n+test_expect_success 'blame ignore commit' '\n+\tgit blame --ignore-commit $IGNORE_SHA one > ignored &&\n+\ttest $(grep -c \"AddLine\" ignored) = 3\n+'\n+\n+test_expect_success 'blame ignore first commit' '\n+\tgit blame --ignore-commit $IGNORE_SHA --ignore-commit $INIT_ADD_SHA \\\n+\t\t$INIT_ADD_SHA.. -- one > ignore_1st &&\n+\ttest $(grep -c \"AddLine\" ignore_1st) = 3\n+'\n+\n+test_expect_success 'blame ignore setup avoid blame_overlap' '\n+\techo A A A >one\n+\tgit add one\n+\tGIT_AUTHOR_NAME=AddLine git commit -m \"add As\"\n+\tINIT_ADD_SHA=`git log --pretty=format:\"%H\" HEAD^..`\n+\techo \" \" A A A >one\n+\tgit add one\n+\tGIT_AUTHOR_NAME=Indent git commit -m \"reindent\"\n+\tIGNORE_SHA=`git log --pretty=format:\"%H\" HEAD^..`\n+'\n+\n+test_expect_success 'blame ignore commit no blame_overlap call' '\n+\tgit blame --ignore-commit $IGNORE_SHA one > ignored &&\n+\ttest $(grep -c \"Indent\" ignored) = 0\n+'\n+\n test_done\n-- \n1.7.1.6.gc7a9\n"},{"id":"140939","messageId":"4BE0918C.9090204@lsrfire.ath.cx","threadId":"23690","inReplyTo":"1272939687-17686-1-git-send-email-dgreid@gmail.com","subject":"Re: [PATCH] blame: can specify shas of commits to ignore on command line","fromName":"René Scharfe","fromEmail":"rene.scharfe@lsrfire.ath.cx","sentAt":"2010-05-04T21:28:44Z","receivedAt":"2010-05-04T21:28:44Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Am 04.05.2010 04:21, schrieb Dylan Reid:\n> Add the ability for git-blame to ignore changes that occur in\n> certain commits.  The new \"-I <sha>\" argument can be used to specify\n> a commit that should be ignored.  This is useful if you have a\n> few commits that you know didn't cause a problem, for example you\n> switched from \"u8\" to \"uint8_t\" and it messed up your history.\n\nOnly the long option --ignore-commit works with your patch, -I doesn't.\n\n>    Allow multiple commits to be specified and store an array in the\n> scoreboard structure so it is accessible.  Add should_ignore_commit\n> function to check if a commit should be ignored. Call\n> \"should_ignore_commit\" from blame_overlap and if the commit should\n> be ignored then pass all the blame on to the parent of the ignored\n> commit.  This is done by calling \"pass_whole_blame\" which has been\n> relocated to a above blame_overlap, but is unchanged.\n> \n> Signed-off-by: Dylan Reid <dgreid@gmail.com>\n> ---\n>  Documentation/blame-options.txt |    6 ++\n>  builtin/blame.c                 |  124 +++++++++++++++++++++++++++++----------\n>  t/t8003-blame.sh                |   42 +++++++++++++\n>  3 files changed, 141 insertions(+), 31 deletions(-)\n\nOh, nice!  And with tests and documentation! :)\n\n> diff --git a/Documentation/blame-options.txt b/Documentation/blame-options.txt\n> index d820569..eb9c825 100644\n> --- a/Documentation/blame-options.txt\n> +++ b/Documentation/blame-options.txt\n> @@ -52,6 +52,12 @@ of lines before or after the line given by <start>.\n>  --porcelain::\n>  \tShow in a format designed for machine consumption.\n>  \n> +--ignore-commit <sha>::\n> +\tIgnore the specified commit when assigning blame.  This is\n> +\tuseful if there are commits in the history that make non\n> +\tfunctional changes to the lines you are interested in\n> +\tfinding blame for.\n> +\n>  --incremental::\n>  \tShow the result incrementally in a format designed for\n>  \tmachine consumption.\n> diff --git a/builtin/blame.c b/builtin/blame.c\n> index fc15863..e4bd095 100644\n> --- a/builtin/blame.c\n> +++ b/builtin/blame.c\n> @@ -176,6 +176,14 @@ struct blame_entry {\n>  };\n>  \n>  /*\n> + * List of any commits to ignore\n> + */\n> +struct ignore_commits {\n> +\tunsigned char (*ignore_shas)[20];\n> +\tunsigned num_ignore_shas;\n> +};\n> +\n> +/*\n>   * The current state of the blame assignment.\n>   */\n>  struct scoreboard {\n> @@ -198,6 +206,9 @@ struct scoreboard {\n>  \t/* look-up a line in the final buffer */\n>  \tint num_lines;\n>  \tint *lineno;\n> +\n> +\t/* List of the shas of commits that should be ignored */\n> +\tstruct ignore_commits *ignored_commits;\n>  };\n>  \n>  static inline int same_suspect(struct origin *a, struct origin *b)\n> @@ -653,6 +664,44 @@ static void decref_split(struct blame_entry *split)\n>  }\n>  \n>  /*\n> + * The blobs of origin and porigin exactly match, so everything\n> + * origin is suspected for can be blamed on the parent.\n> + */\n> +static void pass_whole_blame(struct scoreboard *sb,\n> +\t\t\t     struct origin *origin, struct origin *porigin)\n> +{\n> +   struct blame_entry *e;\n> +\n> +   if (!porigin->file.ptr && origin->file.ptr) {\n> +      /* Steal its file */\n> +      porigin->file = origin->file;\n> +      origin->file.ptr = NULL;\n> +   }\n> +   for (e = sb->ent; e; e = e->next) {\n> +      if (!same_suspect(e->suspect, origin))\n> +\t continue;\n> +      origin_incref(porigin);\n> +      origin_decref(e->suspect);\n> +      e->suspect = porigin;\n> +   }\n> +}\n\nThis function was moved from below, but it seems to be indented with\nthree spaces instead of tabs now.  Adding a declaration without moving\nthe function would avoid that and result in a smaller patch.\n\n> +\n> +/*\n> + * Helper to determine if the given commit should be ignored\n> + */\n> +static unsigned should_ignore_commit(const struct scoreboard *sb,\n> +\t\t\t\t     struct commit *commit)\n> +{\n> +\tunsigned i;\n> +\tunsigned num_shas = sb->ignored_commits->num_ignore_shas;\n> +\tfor(i = 0; i < num_shas; i++)\n> +\t\tif(!hashcmp(commit->object.sha1,\n> +\t\t\t    sb->ignored_commits->ignore_shas[i]))\n> +\t\t\treturn 1;\n> +\treturn 0;\n> +}\n> +\n> +/*\n>   * Helper for blame_chunk().  blame_entry e is known to overlap with\n>   * the patch hunk; split it and pass blame to the parent.\n>   */\n> @@ -660,12 +709,15 @@ static void blame_overlap(struct scoreboard *sb, struct blame_entry *e,\n>  \t\t\t  int tlno, int plno, int same,\n>  \t\t\t  struct origin *parent)\n>  {\n> -\tstruct blame_entry split[3];\n> -\n> -\tsplit_overlap(split, e, tlno, plno, same, parent);\n> -\tif (split[1].suspect)\n> -\t\tsplit_blame(sb, split, e);\n> -\tdecref_split(split);\n> +\tif(should_ignore_commit(sb, e->suspect->commit))\n> +\t\tpass_whole_blame(sb, e->suspect, parent);\n> +\telse {\n> +\t\tstruct blame_entry split[3];\n> +\t\tsplit_overlap(split, e, tlno, plno, same, parent);\n> +\t\tif (split[1].suspect)\n> +\t\t\tsplit_blame(sb, split, e);\n> +\t\tdecref_split(split);\n> +\t}\n>  }\n>  \n>  /*\n> @@ -1105,29 +1157,6 @@ static int find_copy_in_parent(struct scoreboard *sb,\n>  }\n>  \n>  /*\n> - * The blobs of origin and porigin exactly match, so everything\n> - * origin is suspected for can be blamed on the parent.\n> - */\n> -static void pass_whole_blame(struct scoreboard *sb,\n> -\t\t\t     struct origin *origin, struct origin *porigin)\n> -{\n> -\tstruct blame_entry *e;\n> -\n> -\tif (!porigin->file.ptr && origin->file.ptr) {\n> -\t\t/* Steal its file */\n> -\t\tporigin->file = origin->file;\n> -\t\torigin->file.ptr = NULL;\n> -\t}\n> -\tfor (e = sb->ent; e; e = e->next) {\n> -\t\tif (!same_suspect(e->suspect, origin))\n> -\t\t\tcontinue;\n> -\t\torigin_incref(porigin);\n> -\t\torigin_decref(e->suspect);\n> -\t\te->suspect = porigin;\n> -\t}\n> -}\n> -\n> -/*\n>   * We pass blame from the current commit to its parents.  We keep saying\n>   * \"parent\" (and \"porigin\"), but what we mean is to find scapegoat to\n>   * exonerate ourselves.\n> @@ -1540,8 +1569,14 @@ static void assign_blame(struct scoreboard *sb, int opt)\n>  \n>  \t\t/* Take responsibility for the remaining entries */\n>  \t\tfor (ent = sb->ent; ent; ent = ent->next)\n> -\t\t\tif (same_suspect(ent->suspect, suspect))\n> -\t\t\t\tfound_guilty_entry(ent);\n> +\t\t\tif (same_suspect(ent->suspect, suspect)) {\n> +\t\t\t\tif (should_ignore_commit(sb, commit) &&\n> +\t\t\t\t    ent->suspect->previous)\n> +\t\t\t\t\tpass_whole_blame(sb, ent->suspect,\n> +\t\t\t\t\t\t\t ent->suspect->previous);\n> +\t\t\t\telse\n> +\t\t\t\t\tfound_guilty_entry(ent);\n> +\t\t   }\n\nAn ignored commit can still be blamed if there is no other commit to\npass it on.  So e.g. the initial commit for the file could end up being\nblamed for lines that were added by later commits which are being\nignored.  That may look confusing.\n\nWould it make sense to pass the blame to some kind of null commit, i.e.\na special marker that says \"I could tell you who is to blame for this\nline but you said you don't want to know\"?\n\nRené\n"},{"id":"140941","messageId":"j2sfd211a421005041446ub9c2247ai484c2473df856b31@mail.gmail.com","threadId":"23690","inReplyTo":"4BE0918C.9090204@lsrfire.ath.cx","subject":"Re: [PATCH] blame: can specify shas of commits to ignore on command line","fromName":"Dylan Reid","fromEmail":"dgreid@gmail.com","sentAt":"2010-05-04T21:46:59Z","receivedAt":"2010-05-04T21:46:59Z","isPatch":true,"sender":{"key":"dgreid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/113378?v=4"},"body":"Thanks for the speedy reply.\n\n> Only the long option --ignore-commit works with your patch, -I doesn't.\n>\nCorrect.  I took that out because I didn't want to use \"-I' which\ncould eventually be used by a more commonly used feature.  Do you\nagree or do you think it is worth using it.  It's a UI decision I\ndidn't want to make.\n\n>\n> This function was moved from below, but it seems to be indented with\n> three spaces instead of tabs now.  Adding a declaration without moving\n> the function would avoid that and result in a smaller patch.\n>\n\nGood catch, I'll do that and re-send.\n\n>\n> An ignored commit can still be blamed if there is no other commit to\n> pass it on.  So e.g. the initial commit for the file could end up being\n> blamed for lines that were added by later commits which are being\n> ignored.  That may look confusing.\n>\n> Would it make sense to pass the blame to some kind of null commit, i.e.\n> a special marker that says \"I could tell you who is to blame for this\n> line but you said you don't want to know\"?\n>\n\nA null commit could work.  I think the behavior should be to not\nignore the commit. Meaning if you specify a commit that introduced a\nline of code that line of code will still be blamed on the ignored\ncommit.  Does That sound logical or is it too confusing?\n\n\nThanks,\n\nDylan\n"},{"id":"140947","messageId":"7vtyqnl19w.fsf@alter.siamese.dyndns.org","threadId":"23690","inReplyTo":"j2sfd211a421005041446ub9c2247ai484c2473df856b31@mail.gmail.com","subject":"Re: [PATCH] blame: can specify shas of commits to ignore on command line","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-05-04T23:01:31Z","receivedAt":"2010-05-04T23:01:31Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Dylan Reid <dgreid@gmail.com> writes:\n\n> A null commit could work.  I think the behavior should be to not\n> ignore the commit. Meaning if you specify a commit that introduced a\n> line of code that line of code will still be blamed on the ignored\n> commit.  Does That sound logical or is it too confusing?\n\nI am already confused.  If the command must return C when you say \"ignore\nC\" and C introduced a line you are interested in, then what is the point\nof specifying commits to be ignored?\n"},{"id":"140948","messageId":"z2lfd211a421005041608n1e302cbbt1bb628e9b51b3e3@mail.gmail.com","threadId":"23690","inReplyTo":"7vtyqnl19w.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] blame: can specify shas of commits to ignore on command line","fromName":"Dylan Reid","fromEmail":"dgreid@gmail.com","sentAt":"2010-05-04T23:08:56Z","receivedAt":"2010-05-04T23:08:56Z","isPatch":true,"sender":{"key":"dgreid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/113378?v=4"},"body":"> I am already confused.  If the command must return C when you say \"ignore\n> C\" and C introduced a line you are interested in, then what is the point\n> of specifying commits to be ignored?\n>\n\nI was thinking that it would ignore changed lines, not added lines.  Make sense?\n"},{"id":"140963","messageId":"7vfx27kjr6.fsf@alter.siamese.dyndns.org","threadId":"23690","inReplyTo":"z2lfd211a421005041608n1e302cbbt1bb628e9b51b3e3@mail.gmail.com","subject":"Re: [PATCH] blame: can specify shas of commits to ignore on command line","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-05-05T05:19:57Z","receivedAt":"2010-05-05T05:19:57Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Dylan Reid <dgreid@gmail.com> writes:\n\n>> I am already confused.  If the command must return C when you say \"ignore\n>> C\" and C introduced a line you are interested in, then what is the point\n>> of specifying commits to be ignored?\n>>\n>\n> I was thinking that it would ignore changed lines, not added lines.  Make sense?\n\nNot really.  I don't think you can distinguish \"changed lines\" and \"added\nlines\" reliably.\n"},{"id":"140964","messageId":"l2wfd211a421005042228rd6386ff9k9bc54c5862209785@mail.gmail.com","threadId":"23690","inReplyTo":"7vfx27kjr6.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] blame: can specify shas of commits to ignore on command line","fromName":"Dylan Reid","fromEmail":"dgreid@gmail.com","sentAt":"2010-05-05T05:28:08Z","receivedAt":"2010-05-05T05:28:08Z","isPatch":true,"sender":{"key":"dgreid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/113378?v=4"},"body":"I've noticed that trying to come up with a solution tonight.  I'll\nlook at it some more tomorrow.  If you can't tell the difference\nbetween added and changed then there would be no easy way to mark a\nline as ignored either.\n\nIf the changes get split fine enough could you tell that blame_ent\ndoesn't exist in a parent commit?\n\nThanks,\n\nDylan\n\nOn Wed, May 5, 2010 at 1:19 AM, Junio C Hamano <gitster@pobox.com> wrote:\n> Dylan Reid <dgreid@gmail.com> writes:\n>\n>>> I am already confused.  If the command must return C when you say \"ignore\n>>> C\" and C introduced a line you are interested in, then what is the point\n>>> of specifying commits to be ignored?\n>>>\n>>\n>> I was thinking that it would ignore changed lines, not added lines.  Make sense?\n>\n> Not really.  I don't think you can distinguish \"changed lines\" and \"added\n> lines\" reliably.\n>\n"},{"id":"186494","messageId":"1331240473379-7356224.post@n2.nabble.com","threadId":"23690","inReplyTo":"l2wfd211a421005042228rd6386ff9k9bc54c5862209785@mail.gmail.com","subject":"Re: [PATCH] blame: can specify shas of commits to ignore on command line","fromName":"cnighswonger","fromEmail":"chris.nighswonger@gmail.com","sentAt":"2012-03-08T21:01:13Z","receivedAt":"2012-03-08T21:01:13Z","isPatch":true,"sender":{"key":"chris.nighswonger@gmail.com","avatar":null},"body":"I'm not subscribed to the list, so please reply-to-all or cc me on responses.\n\nIs this feature dead? There seems to be some question about the value of\nsuch a feature in the discussion along this thread, however, such a feature\nwould have the wonderful benefit of allowing a change such as that being\ndiscussed here:\nhttp://koha.1045719.n5.nabble.com/Koha-3-8-release-schedule-amp-perltidy-process-td5547369.html\nto be made and yet preserve the usefulness of git-blame.\n\nTo recap the issue in the thread at koha-devel:\n\nA massive perl-tidy is being considered to be applied project wide in a\nsingle commit. The real show-stopper is that this breaks git-blame. If\ngit-blame could be told to ignore that single commit id, life would be good\n(I think).\n\nAt any rate it provides a use-case which might justify such a feature.\n\nKind Regards,\nChris\n\n--\nView this message in context: http://git.661346.n2.nabble.com/PATCH-blame-can-specify-shas-of-commits-to-ignore-on-command-line-tp5001395p7356224.html\nSent from the git mailing list archive at Nabble.com.\n"}]}