{"thread":{"id":"41400","subject":"Git patch shows tab but files doesn't","startedAt":"2016-02-12T16:02:32Z","lastAt":"2016-02-12T18:32:38Z","messageCount":2,"participants":["Jagan Teki","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"278015","messageId":"CAD6G_RTJuNsR6qawgco1H+ocKPThk1HsQLvhQigmzUb_c7UdaQ@mail.gmail.com","threadId":"41400","inReplyTo":null,"subject":"Git patch shows tab but files doesn't","fromName":"Jagan Teki","fromEmail":"jteki@openedev.com","sentAt":"2016-02-12T16:02:32Z","receivedAt":"2016-02-12T16:02:32Z","isPatch":false,"sender":{"key":"jteki@openedev.com","avatar":null},"body":"Hi,\n\nI edited a file as one space between #define and macro and tab space\nbetween macro and BIT value, similar as below.\n\n#define USE_FSR           BIT(6)\n#define SNOR_WR         BIT(7)\n\nOnce I created the patch looks different as tab space between #define\nand macro and 2 tab spaces between macro and BIT value looks like it's\nadded tab spaces while creating a patch as below.\n\n+#define        USE_FSR                              BIT(6)\n+#define        SNOR_WR                            BIT(7)\n\nAny help how to fix this, was it an issues with vim or do we have any\ngit-config fixes for this?\n\n-- \nJagan.\n"},{"id":"278023","messageId":"20160212183238.GB19973@sigill.intra.peff.net","threadId":"41400","inReplyTo":"CAD6G_RTJuNsR6qawgco1H+ocKPThk1HsQLvhQigmzUb_c7UdaQ@mail.gmail.com","subject":"Re: Git patch shows tab but files doesn't","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2016-02-12T18:32:38Z","receivedAt":"2016-02-12T18:32:38Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, Feb 12, 2016 at 09:32:32PM +0530, Jagan Teki wrote:\n\n> Hi,\n> \n> I edited a file as one space between #define and macro and tab space\n> between macro and BIT value, similar as below.\n> \n> #define USE_FSR           BIT(6)\n> #define SNOR_WR         BIT(7)\n> \n> Once I created the patch looks different as tab space between #define\n> and macro and 2 tab spaces between macro and BIT value looks like it's\n> added tab spaces while creating a patch as below.\n> \n> +#define        USE_FSR                              BIT(6)\n> +#define        SNOR_WR                            BIT(7)\n> \n> Any help how to fix this, was it an issues with vim or do we have any\n> git-config fixes for this?\n\nIt's hard to tell from your output, but you can often get tab\nrealignment on your terminal when viewing a patch, because the tabs are\nshifted in by one character (the leading \"+\"). So if your terminal\nis showing (as most do) a tab as \"skip to the next tabstop\", then:\n\n  1. The size of particular tabs may look quite different if they move\n     from an exact tabstop to the next character (or vice versa).\n\n     If the space between your \"#define\" and the macro name is actually\n     a tab, then I'd expect it to exhibit this behavior with a tabstop\n     of 8 (because #define is 7 chars).\n\n  2. Spaces don't exhibit this, so two lines which _are_ aligned in the\n     source for a specific tabstop may not be in the patch.\n\nPiping the diff (and your file) through \"cat -A\" can often show more\nclearly what's going on.\n\n-Peff\n"}]}