{
    "content": [
        {
            "type": "text",
            "text": "# GITDIFFCORE(7) (man)\n\n**Summary:** gitdiffcore - Tweaking diff output\n\n**Synopsis:** git diff *\n\n## See Also\n\n- git-diff(1)\n- git-diff-files(1)\n- git-diff-index(1)\n- git-diff-tree(1)\n- git-format-patch(1)\n- git-log(1)\n- gitglossary(7)\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **SYNOPSIS** (3 lines)\n- **DESCRIPTION** (6 lines)\n- **THE CHAIN OF OPERATION** (54 lines) — 6 subsections\n  - DIFFCORE-BREAK: FOR SPLITTING UP COMPLETE REWRITES (24 lines)\n  - DIFFCORE-RENAME: FOR DETECTING RENAMES AND COPIES (57 lines)\n  - DIFFCORE-MERGE-BROKEN: FOR PUTTING COMPLETE REWRITES BACK TO (27 lines)\n  - DIFFCORE-PICKAXE: FOR DETECTING ADDITION/DELETION OF SPECIFI (23 lines)\n  - DIFFCORE-ORDER: FOR SORTING THE OUTPUT BASED ON FILENAMES (17 lines)\n  - DIFFCORE-ROTATE: FOR CHANGING AT WHICH PATH OUTPUT STARTS (12 lines)\n- **SEE ALSO** (3 lines)\n- **GIT** (2 lines)\n- **NOTES** (6 lines)\n\n## Full Content\n\n### NAME\n\ngitdiffcore - Tweaking diff output\n\n### SYNOPSIS\n\ngit diff *\n\n### DESCRIPTION\n\nThe diff commands git diff-index, git diff-files, and git diff-tree can be told to manipulate\ndifferences they find in unconventional ways before showing diff output. The manipulation is\ncollectively called \"diffcore transformation\". This short note describes what they are and\nhow to use them to produce diff output that is easier to understand than the conventional\nkind.\n\n### THE CHAIN OF OPERATION\n\nThe git diff-* family works by first comparing two sets of files:\n\n•   git diff-index compares contents of a \"tree\" object and the working directory (when\n--cached flag is not used) or a \"tree\" object and the index file (when --cached flag is\nused);\n\n•   git diff-files compares contents of the index file and the working directory;\n\n•   git diff-tree compares contents of two \"tree\" objects;\n\nIn all of these cases, the commands themselves first optionally limit the two sets of files\nby any pathspecs given on their command-lines, and compare corresponding paths in the two\nresulting sets of files.\n\nThe pathspecs are used to limit the world diff operates in. They remove the filepairs outside\nthe specified sets of pathnames. E.g. If the input set of filepairs included:\n\n:100644 100644 bcd1234... 0123456... M junkfile\n\n\nbut the command invocation was git diff-files myfile, then the junkfile entry would be\nremoved from the list because only \"myfile\" is under consideration.\n\nThe result of comparison is passed from these commands to what is internally called\n\"diffcore\", in a format similar to what is output when the -p option is not used. E.g.\n\nin-place edit  :100644 100644 bcd1234... 0123456... M file0\ncreate         :000000 100644 0000000... 1234567... A file4\ndelete         :100644 000000 1234567... 0000000... D file5\nunmerged       :000000 000000 0000000... 0000000... U file6\n\n\nThe diffcore mechanism is fed a list of such comparison results (each of which is called\n\"filepair\", although at this point each of them talks about a single file), and transforms\nsuch a list into another list. There are currently 5 such transformations:\n\n•   diffcore-break\n\n•   diffcore-rename\n\n•   diffcore-merge-broken\n\n•   diffcore-pickaxe\n\n•   diffcore-order\n\n•   diffcore-rotate\n\nThese are applied in sequence. The set of filepairs git diff-* commands find are used as the\ninput to diffcore-break, and the output from diffcore-break is used as the input to the next\ntransformation. The final result is then passed to the output routine and generates either\ndiff-raw format (see Output format sections of the manual for git diff-* commands) or\ndiff-patch format.\n\n#### DIFFCORE-BREAK: FOR SPLITTING UP COMPLETE REWRITES\n\nThe second transformation in the chain is diffcore-break, and is controlled by the -B option\nto the git diff-* commands. This is used to detect a filepair that represents \"complete\nrewrite\" and break such filepair into two filepairs that represent delete and create. E.g. If\nthe input contained this filepair:\n\n:100644 100644 bcd1234... 0123456... M file0\n\n\nand if it detects that the file \"file0\" is completely rewritten, it changes it to:\n\n:100644 000000 bcd1234... 0000000... D file0\n:000000 100644 0000000... 0123456... A file0\n\n\nFor the purpose of breaking a filepair, diffcore-break examines the extent of changes between\nthe contents of the files before and after modification (i.e. the contents that have\n\"bcd1234...\" and \"0123456...\" as their SHA-1 content ID, in the above example). The amount of\ndeletion of original contents and insertion of new material are added together, and if it\nexceeds the \"break score\", the filepair is broken into two. The break score defaults to 50%\nof the size of the smaller of the original and the result (i.e. if the edit shrinks the file,\nthe size of the result is used; if the edit lengthens the file, the size of the original is\nused), and can be customized by giving a number after \"-B\" option (e.g. \"-B75\" to tell it to\nuse 75%).\n\n#### DIFFCORE-RENAME: FOR DETECTING RENAMES AND COPIES\n\nThis transformation is used to detect renames and copies, and is controlled by the -M option\n(to detect renames) and the -C option (to detect copies as well) to the git diff-* commands.\nIf the input contained these filepairs:\n\n:100644 000000 0123456... 0000000... D fileX\n:000000 100644 0000000... 0123456... A file0\n\n\nand the contents of the deleted file fileX is similar enough to the contents of the created\nfile file0, then rename detection merges these filepairs and creates:\n\n:100644 100644 0123456... 0123456... R100 fileX file0\n\n\nWhen the \"-C\" option is used, the original contents of modified files, and deleted files (and\nalso unmodified files, if the \"--find-copies-harder\" option is used) are considered as\ncandidates of the source files in rename/copy operation. If the input were like these\nfilepairs, that talk about a modified file fileY and a newly created file file0:\n\n:100644 100644 0123456... 1234567... M fileY\n:000000 100644 0000000... bcd3456... A file0\n\n\nthe original contents of fileY and the resulting contents of file0 are compared, and if they\nare similar enough, they are changed to:\n\n:100644 100644 0123456... 1234567... M fileY\n:100644 100644 0123456... bcd3456... C100 fileY file0\n\n\nIn both rename and copy detection, the same \"extent of changes\" algorithm used in\ndiffcore-break is used to determine if two files are \"similar enough\", and can be customized\nto use a similarity score different from the default of 50% by giving a number after the \"-M\"\nor \"-C\" option (e.g. \"-M8\" to tell it to use 8/10 = 80%).\n\nNote that when rename detection is on but both copy and break detection are off, rename\ndetection adds a preliminary step that first checks if files are moved across directories\nwhile keeping their filename the same. If there is a file added to a directory whose contents\nis sufficiently similar to a file with the same name that got deleted from a different\ndirectory, it will mark them as renames and exclude them from the later quadratic step (the\none that pairwise compares all unmatched files to find the \"best\" matches, determined by the\nhighest content similarity). So, for example, if a deleted docs/ext.txt and an added\ndocs/config/ext.txt are similar enough, they will be marked as a rename and prevent an added\ndocs/ext.md that may be even more similar to the deleted docs/ext.txt from being considered\nas the rename destination in the later step. For this reason, the preliminary \"match same\nfilename\" step uses a bit higher threshold to mark a file pair as a rename and stop\nconsidering other candidates for better matches. At most, one comparison is done per file in\nthis preliminary pass; so if there are several remaining ext.txt files throughout the\ndirectory hierarchy after exact rename detection, this preliminary step may be skipped for\nthose files.\n\nNote. When the \"-C\" option is used with --find-copies-harder option, git diff-* commands feed\nunmodified filepairs to diffcore mechanism as well as modified ones. This lets the copy\ndetector consider unmodified files as copy source candidates at the expense of making it\nslower. Without --find-copies-harder, git diff-* commands can detect copies only if the file\nthat was copied happened to have been modified in the same changeset.\n\n#### DIFFCORE-MERGE-BROKEN: FOR PUTTING COMPLETE REWRITES BACK TOGETHER\n\nThis transformation is used to merge filepairs broken by diffcore-break, and not transformed\ninto rename/copy by diffcore-rename, back into a single modification. This always runs when\ndiffcore-break is used.\n\nFor the purpose of merging broken filepairs back, it uses a different \"extent of changes\"\ncomputation from the ones used by diffcore-break and diffcore-rename. It counts only the\ndeletion from the original, and does not count insertion. If you removed only 10 lines from a\n100-line document, even if you added 910 new lines to make a new 1000-line document, you did\nnot do a complete rewrite. diffcore-break breaks such a case in order to help diffcore-rename\nto consider such filepairs as candidate of rename/copy detection, but if filepairs broken\nthat way were not matched with other filepairs to create rename/copy, then this\ntransformation merges them back into the original \"modification\".\n\nThe \"extent of changes\" parameter can be tweaked from the default 80% (that is, unless more\nthan 80% of the original material is deleted, the broken pairs are merged back into a single\nmodification) by giving a second number to -B option, like these:\n\n•   -B50/60 (give 50% \"break score\" to diffcore-break, use 60% for diffcore-merge-broken).\n\n•   -B/60 (the same as above, since diffcore-break defaults to 50%).\n\nNote that earlier implementation left a broken pair as a separate creation and deletion\npatches. This was an unnecessary hack and the latest implementation always merges all the\nbroken pairs back into modifications, but the resulting patch output is formatted differently\nfor easier review in case of such a complete rewrite by showing the entire contents of old\nversion prefixed with -, followed by the entire contents of new version prefixed with +.\n\n#### DIFFCORE-PICKAXE: FOR DETECTING ADDITION/DELETION OF SPECIFIED STRING\n\nThis transformation limits the set of filepairs to those that change specified strings\nbetween the preimage and the postimage in a certain way. -S<block of text> and -G<regular\nexpression> options are used to specify different ways these strings are sought.\n\n\"-S<block of text>\" detects filepairs whose preimage and postimage have different number of\noccurrences of the specified block of text. By definition, it will not detect in-file moves.\nAlso, when a changeset moves a file wholesale without affecting the interesting string,\ndiffcore-rename kicks in as usual, and -S omits the filepair (since the number of occurrences\nof that string didn’t change in that rename-detected filepair). When used with\n--pickaxe-regex, treat the <block of text> as an extended POSIX regular expression to match,\ninstead of a literal string.\n\n\"-G<regular expression>\" (mnemonic: grep) detects filepairs whose textual diff has an added\nor a deleted line that matches the given regular expression. This means that it will detect\nin-file (or what rename-detection considers the same file) moves, which is noise. The\nimplementation runs diff twice and greps, and this can be quite expensive. To speed things up\nbinary files without textconv filters will be ignored.\n\nWhen -S or -G are used without --pickaxe-all, only filepairs that match their respective\ncriterion are kept in the output. When --pickaxe-all is used, if even one filepair matches\ntheir respective criterion in a changeset, the entire changeset is kept. This behavior is\ndesigned to make reviewing changes in the context of the whole changeset easier.\n\n#### DIFFCORE-ORDER: FOR SORTING THE OUTPUT BASED ON FILENAMES\n\nThis is used to reorder the filepairs according to the user’s (or project’s) taste, and is\ncontrolled by the -O option to the git diff-* commands.\n\nThis takes a text file each of whose lines is a shell glob pattern. Filepairs that match a\nglob pattern on an earlier line in the file are output before ones that match a later line,\nand filepairs that do not match any glob pattern are output last.\n\nAs an example, a typical orderfile for the core Git probably would look like this:\n\nREADME\nMakefile\nDocumentation\n*.h\n*.c\nt\n\n#### DIFFCORE-ROTATE: FOR CHANGING AT WHICH PATH OUTPUT STARTS\n\nThis transformation takes one pathname, and rotates the set of filepairs so that the filepair\nfor the given pathname comes first, optionally discarding the paths that come before it. This\nis used to implement the --skip-to and the --rotate-to options. It is an error when the\nspecified pathname is not in the set of filepairs, but it is not useful to error out when\nused with \"git log\" family of commands, because it is unreasonable to expect that a given\npath would be modified by each and every commit shown by the \"git log\" command. For this\nreason, when used with \"git log\", the filepair that sorts the same as, or the first one that\nsorts after, the given pathname is where the output starts.\n\nUse of this transformation combined with diffcore-order will produce unexpected results, as\nthe input to this transformation is likely not sorted when diffcore-order is in effect.\n\n### SEE ALSO\n\ngit-diff(1), git-diff-files(1), git-diff-index(1), git-diff-tree(1), git-format-patch(1),\ngit-log(1), gitglossary(7), The Git User’’s Manual[1]\n\n### GIT\n\nPart of the git(1) suite\n\n### NOTES\n\n1. The Git User’s Manual\nfile:///usr/share/doc/git/html/user-manual.html\n\n\n\nGit 2.34.1                                   02/26/2026                               GITDIFFCORE(7)\n\n"
        }
    ],
    "structuredContent": {
        "command": "GITDIFFCORE",
        "section": "7",
        "mode": "man",
        "summary": "gitdiffcore - Tweaking diff output",
        "synopsis": "git diff *",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [
            {
                "name": "git-diff",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/git-diff/1/json"
            },
            {
                "name": "git-diff-files",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/git-diff-files/1/json"
            },
            {
                "name": "git-diff-index",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/git-diff-index/1/json"
            },
            {
                "name": "git-diff-tree",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/git-diff-tree/1/json"
            },
            {
                "name": "git-format-patch",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/git-format-patch/1/json"
            },
            {
                "name": "git-log",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/git-log/1/json"
            },
            {
                "name": "gitglossary",
                "section": "7",
                "url": "https://www.chedong.com/phpMan.php/man/gitglossary/7/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 6,
                "subsections": []
            },
            {
                "name": "THE CHAIN OF OPERATION",
                "lines": 54,
                "subsections": [
                    {
                        "name": "DIFFCORE-BREAK: FOR SPLITTING UP COMPLETE REWRITES",
                        "lines": 24
                    },
                    {
                        "name": "DIFFCORE-RENAME: FOR DETECTING RENAMES AND COPIES",
                        "lines": 57
                    },
                    {
                        "name": "DIFFCORE-MERGE-BROKEN: FOR PUTTING COMPLETE REWRITES BACK TOGETHER",
                        "lines": 27
                    },
                    {
                        "name": "DIFFCORE-PICKAXE: FOR DETECTING ADDITION/DELETION OF SPECIFIED STRING",
                        "lines": 23
                    },
                    {
                        "name": "DIFFCORE-ORDER: FOR SORTING THE OUTPUT BASED ON FILENAMES",
                        "lines": 17
                    },
                    {
                        "name": "DIFFCORE-ROTATE: FOR CHANGING AT WHICH PATH OUTPUT STARTS",
                        "lines": 12
                    }
                ]
            },
            {
                "name": "SEE ALSO",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "GIT",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "NOTES",
                "lines": 6,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "gitdiffcore - Tweaking diff output\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "git diff *\n\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "The diff commands git diff-index, git diff-files, and git diff-tree can be told to manipulate\ndifferences they find in unconventional ways before showing diff output. The manipulation is\ncollectively called \"diffcore transformation\". This short note describes what they are and\nhow to use them to produce diff output that is easier to understand than the conventional\nkind.\n",
                "subsections": []
            },
            "THE CHAIN OF OPERATION": {
                "content": "The git diff-* family works by first comparing two sets of files:\n\n•   git diff-index compares contents of a \"tree\" object and the working directory (when\n--cached flag is not used) or a \"tree\" object and the index file (when --cached flag is\nused);\n\n•   git diff-files compares contents of the index file and the working directory;\n\n•   git diff-tree compares contents of two \"tree\" objects;\n\nIn all of these cases, the commands themselves first optionally limit the two sets of files\nby any pathspecs given on their command-lines, and compare corresponding paths in the two\nresulting sets of files.\n\nThe pathspecs are used to limit the world diff operates in. They remove the filepairs outside\nthe specified sets of pathnames. E.g. If the input set of filepairs included:\n\n:100644 100644 bcd1234... 0123456... M junkfile\n\n\nbut the command invocation was git diff-files myfile, then the junkfile entry would be\nremoved from the list because only \"myfile\" is under consideration.\n\nThe result of comparison is passed from these commands to what is internally called\n\"diffcore\", in a format similar to what is output when the -p option is not used. E.g.\n\nin-place edit  :100644 100644 bcd1234... 0123456... M file0\ncreate         :000000 100644 0000000... 1234567... A file4\ndelete         :100644 000000 1234567... 0000000... D file5\nunmerged       :000000 000000 0000000... 0000000... U file6\n\n\nThe diffcore mechanism is fed a list of such comparison results (each of which is called\n\"filepair\", although at this point each of them talks about a single file), and transforms\nsuch a list into another list. There are currently 5 such transformations:\n\n•   diffcore-break\n\n•   diffcore-rename\n\n•   diffcore-merge-broken\n\n•   diffcore-pickaxe\n\n•   diffcore-order\n\n•   diffcore-rotate\n\nThese are applied in sequence. The set of filepairs git diff-* commands find are used as the\ninput to diffcore-break, and the output from diffcore-break is used as the input to the next\ntransformation. The final result is then passed to the output routine and generates either\ndiff-raw format (see Output format sections of the manual for git diff-* commands) or\ndiff-patch format.\n",
                "subsections": [
                    {
                        "name": "DIFFCORE-BREAK: FOR SPLITTING UP COMPLETE REWRITES",
                        "content": "The second transformation in the chain is diffcore-break, and is controlled by the -B option\nto the git diff-* commands. This is used to detect a filepair that represents \"complete\nrewrite\" and break such filepair into two filepairs that represent delete and create. E.g. If\nthe input contained this filepair:\n\n:100644 100644 bcd1234... 0123456... M file0\n\n\nand if it detects that the file \"file0\" is completely rewritten, it changes it to:\n\n:100644 000000 bcd1234... 0000000... D file0\n:000000 100644 0000000... 0123456... A file0\n\n\nFor the purpose of breaking a filepair, diffcore-break examines the extent of changes between\nthe contents of the files before and after modification (i.e. the contents that have\n\"bcd1234...\" and \"0123456...\" as their SHA-1 content ID, in the above example). The amount of\ndeletion of original contents and insertion of new material are added together, and if it\nexceeds the \"break score\", the filepair is broken into two. The break score defaults to 50%\nof the size of the smaller of the original and the result (i.e. if the edit shrinks the file,\nthe size of the result is used; if the edit lengthens the file, the size of the original is\nused), and can be customized by giving a number after \"-B\" option (e.g. \"-B75\" to tell it to\nuse 75%).\n"
                    },
                    {
                        "name": "DIFFCORE-RENAME: FOR DETECTING RENAMES AND COPIES",
                        "content": "This transformation is used to detect renames and copies, and is controlled by the -M option\n(to detect renames) and the -C option (to detect copies as well) to the git diff-* commands.\nIf the input contained these filepairs:\n\n:100644 000000 0123456... 0000000... D fileX\n:000000 100644 0000000... 0123456... A file0\n\n\nand the contents of the deleted file fileX is similar enough to the contents of the created\nfile file0, then rename detection merges these filepairs and creates:\n\n:100644 100644 0123456... 0123456... R100 fileX file0\n\n\nWhen the \"-C\" option is used, the original contents of modified files, and deleted files (and\nalso unmodified files, if the \"--find-copies-harder\" option is used) are considered as\ncandidates of the source files in rename/copy operation. If the input were like these\nfilepairs, that talk about a modified file fileY and a newly created file file0:\n\n:100644 100644 0123456... 1234567... M fileY\n:000000 100644 0000000... bcd3456... A file0\n\n\nthe original contents of fileY and the resulting contents of file0 are compared, and if they\nare similar enough, they are changed to:\n\n:100644 100644 0123456... 1234567... M fileY\n:100644 100644 0123456... bcd3456... C100 fileY file0\n\n\nIn both rename and copy detection, the same \"extent of changes\" algorithm used in\ndiffcore-break is used to determine if two files are \"similar enough\", and can be customized\nto use a similarity score different from the default of 50% by giving a number after the \"-M\"\nor \"-C\" option (e.g. \"-M8\" to tell it to use 8/10 = 80%).\n\nNote that when rename detection is on but both copy and break detection are off, rename\ndetection adds a preliminary step that first checks if files are moved across directories\nwhile keeping their filename the same. If there is a file added to a directory whose contents\nis sufficiently similar to a file with the same name that got deleted from a different\ndirectory, it will mark them as renames and exclude them from the later quadratic step (the\none that pairwise compares all unmatched files to find the \"best\" matches, determined by the\nhighest content similarity). So, for example, if a deleted docs/ext.txt and an added\ndocs/config/ext.txt are similar enough, they will be marked as a rename and prevent an added\ndocs/ext.md that may be even more similar to the deleted docs/ext.txt from being considered\nas the rename destination in the later step. For this reason, the preliminary \"match same\nfilename\" step uses a bit higher threshold to mark a file pair as a rename and stop\nconsidering other candidates for better matches. At most, one comparison is done per file in\nthis preliminary pass; so if there are several remaining ext.txt files throughout the\ndirectory hierarchy after exact rename detection, this preliminary step may be skipped for\nthose files.\n\nNote. When the \"-C\" option is used with --find-copies-harder option, git diff-* commands feed\nunmodified filepairs to diffcore mechanism as well as modified ones. This lets the copy\ndetector consider unmodified files as copy source candidates at the expense of making it\nslower. Without --find-copies-harder, git diff-* commands can detect copies only if the file\nthat was copied happened to have been modified in the same changeset.\n"
                    },
                    {
                        "name": "DIFFCORE-MERGE-BROKEN: FOR PUTTING COMPLETE REWRITES BACK TOGETHER",
                        "content": "This transformation is used to merge filepairs broken by diffcore-break, and not transformed\ninto rename/copy by diffcore-rename, back into a single modification. This always runs when\ndiffcore-break is used.\n\nFor the purpose of merging broken filepairs back, it uses a different \"extent of changes\"\ncomputation from the ones used by diffcore-break and diffcore-rename. It counts only the\ndeletion from the original, and does not count insertion. If you removed only 10 lines from a\n100-line document, even if you added 910 new lines to make a new 1000-line document, you did\nnot do a complete rewrite. diffcore-break breaks such a case in order to help diffcore-rename\nto consider such filepairs as candidate of rename/copy detection, but if filepairs broken\nthat way were not matched with other filepairs to create rename/copy, then this\ntransformation merges them back into the original \"modification\".\n\nThe \"extent of changes\" parameter can be tweaked from the default 80% (that is, unless more\nthan 80% of the original material is deleted, the broken pairs are merged back into a single\nmodification) by giving a second number to -B option, like these:\n\n•   -B50/60 (give 50% \"break score\" to diffcore-break, use 60% for diffcore-merge-broken).\n\n•   -B/60 (the same as above, since diffcore-break defaults to 50%).\n\nNote that earlier implementation left a broken pair as a separate creation and deletion\npatches. This was an unnecessary hack and the latest implementation always merges all the\nbroken pairs back into modifications, but the resulting patch output is formatted differently\nfor easier review in case of such a complete rewrite by showing the entire contents of old\nversion prefixed with -, followed by the entire contents of new version prefixed with +.\n"
                    },
                    {
                        "name": "DIFFCORE-PICKAXE: FOR DETECTING ADDITION/DELETION OF SPECIFIED STRING",
                        "content": "This transformation limits the set of filepairs to those that change specified strings\nbetween the preimage and the postimage in a certain way. -S<block of text> and -G<regular\nexpression> options are used to specify different ways these strings are sought.\n\n\"-S<block of text>\" detects filepairs whose preimage and postimage have different number of\noccurrences of the specified block of text. By definition, it will not detect in-file moves.\nAlso, when a changeset moves a file wholesale without affecting the interesting string,\ndiffcore-rename kicks in as usual, and -S omits the filepair (since the number of occurrences\nof that string didn’t change in that rename-detected filepair). When used with\n--pickaxe-regex, treat the <block of text> as an extended POSIX regular expression to match,\ninstead of a literal string.\n\n\"-G<regular expression>\" (mnemonic: grep) detects filepairs whose textual diff has an added\nor a deleted line that matches the given regular expression. This means that it will detect\nin-file (or what rename-detection considers the same file) moves, which is noise. The\nimplementation runs diff twice and greps, and this can be quite expensive. To speed things up\nbinary files without textconv filters will be ignored.\n\nWhen -S or -G are used without --pickaxe-all, only filepairs that match their respective\ncriterion are kept in the output. When --pickaxe-all is used, if even one filepair matches\ntheir respective criterion in a changeset, the entire changeset is kept. This behavior is\ndesigned to make reviewing changes in the context of the whole changeset easier.\n"
                    },
                    {
                        "name": "DIFFCORE-ORDER: FOR SORTING THE OUTPUT BASED ON FILENAMES",
                        "content": "This is used to reorder the filepairs according to the user’s (or project’s) taste, and is\ncontrolled by the -O option to the git diff-* commands.\n\nThis takes a text file each of whose lines is a shell glob pattern. Filepairs that match a\nglob pattern on an earlier line in the file are output before ones that match a later line,\nand filepairs that do not match any glob pattern are output last.\n\nAs an example, a typical orderfile for the core Git probably would look like this:\n\nREADME\nMakefile\nDocumentation\n*.h\n*.c\nt\n\n"
                    },
                    {
                        "name": "DIFFCORE-ROTATE: FOR CHANGING AT WHICH PATH OUTPUT STARTS",
                        "content": "This transformation takes one pathname, and rotates the set of filepairs so that the filepair\nfor the given pathname comes first, optionally discarding the paths that come before it. This\nis used to implement the --skip-to and the --rotate-to options. It is an error when the\nspecified pathname is not in the set of filepairs, but it is not useful to error out when\nused with \"git log\" family of commands, because it is unreasonable to expect that a given\npath would be modified by each and every commit shown by the \"git log\" command. For this\nreason, when used with \"git log\", the filepair that sorts the same as, or the first one that\nsorts after, the given pathname is where the output starts.\n\nUse of this transformation combined with diffcore-order will produce unexpected results, as\nthe input to this transformation is likely not sorted when diffcore-order is in effect.\n"
                    }
                ]
            },
            "SEE ALSO": {
                "content": "git-diff(1), git-diff-files(1), git-diff-index(1), git-diff-tree(1), git-format-patch(1),\ngit-log(1), gitglossary(7), The Git User’’s Manual[1]\n",
                "subsections": []
            },
            "GIT": {
                "content": "Part of the git(1) suite\n",
                "subsections": []
            },
            "NOTES": {
                "content": "1. The Git User’s Manual\nfile:///usr/share/doc/git/html/user-manual.html\n\n\n\nGit 2.34.1                                   02/26/2026                               GITDIFFCORE(7)",
                "subsections": []
            }
        }
    }
}