{"thread":{"id":"51614","subject":"\"git log\" does not display refs info when executed via C# Process class on Windows","startedAt":"2019-08-09T19:36:23Z","lastAt":"2019-08-09T22:16:44Z","messageCount":6,"participants":["Cliff Schomburg","SZEDER Gábor","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"380239","messageId":"BN8PR21MB11569DAA8A677BF00113F683B7D60@BN8PR21MB1156.namprd21.prod.outlook.com","threadId":"51614","inReplyTo":null,"subject":"\"git log\" does not display refs info when executed via C# Process class on Windows","fromName":"Cliff Schomburg","fromEmail":"clisc@microsoft.com","sentAt":"2019-08-09T19:36:19Z","receivedAt":"2019-08-09T19:36:23Z","isPatch":false,"sender":{"key":"clisc@microsoft.com","avatar":null},"body":"Hello,\n\nI have an open Git for Windows issue here:\nhttps://github.com/git-for-windows/git/issues/2285\n\n\"git log\" works as expected from the command prompt.  But when I execute it via C# Process class and read from Standard Output, the refs are missing.\n\nIs anyone familiar with this issue?  Any idea why the output to CMD and STDOUT would be different?\n\nThanks,\nCliff\n\n"},{"id":"380240","messageId":"20190809195031.GK20404@szeder.dev","threadId":"51614","inReplyTo":"BN8PR21MB11569DAA8A677BF00113F683B7D60@BN8PR21MB1156.namprd21.prod.outlook.com","subject":"Re: \"git log\" does not display refs info when executed via C# Process class on Windows","fromName":"SZEDER Gábor","fromEmail":"szeder.dev@gmail.com","sentAt":"2019-08-09T19:50:31Z","receivedAt":"2019-08-09T19:50:38Z","isPatch":false,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"On Fri, Aug 09, 2019 at 07:36:19PM +0000, Cliff Schomburg wrote:\n> I have an open Git for Windows issue here:\n> https://github.com/git-for-windows/git/issues/2285\n> \n> \"git log\" works as expected from the command prompt.  But when I execute it via C# Process class and read from Standard Output, the refs are missing.\n> \n> Is anyone familiar with this issue?  Any idea why the output to CMD and STDOUT would be different?\n\nDecorations, like color and refs pointing to a commit, are for humans,\nand humans read the terminal.  If the command's output doesn't go to a\nterminal, then no such decorations are shown by default.\n\nTry invoking 'git log --decorate'; or, better yet, use your custom\n'--format=', especially if you intend to parse the output, \n\n"},{"id":"380242","messageId":"BN8PR21MB11565C3CD2522EA8BB887AA9B7D60@BN8PR21MB1156.namprd21.prod.outlook.com","threadId":"51614","inReplyTo":"20190809195031.GK20404@szeder.dev","subject":"RE: \"git log\" does not display refs info when executed via C# Process class on Windows","fromName":"Cliff Schomburg","fromEmail":"clisc@microsoft.com","sentAt":"2019-08-09T20:11:33Z","receivedAt":"2019-08-09T20:11:37Z","isPatch":false,"sender":{"key":"clisc@microsoft.com","avatar":null},"body":"Adding --decorate gave me the desired result.\n\nThanks for your help!\n\n-----Original Message-----\nFrom: SZEDER Gábor <szeder.dev@gmail.com> \nSent: Friday, August 9, 2019 3:51 PM\nTo: Cliff Schomburg <clisc@microsoft.com>\nCc: git@vger.kernel.org\nSubject: Re: \"git log\" does not display refs info when executed via C# Process class on Windows\n\nOn Fri, Aug 09, 2019 at 07:36:19PM +0000, Cliff Schomburg wrote:\n> I have an open Git for Windows issue here:\n> https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgith\n> ub.com%2Fgit-for-windows%2Fgit%2Fissues%2F2285&amp;data=02%7C01%7Cclis\n> c%40microsoft.com%7C17689ee8d32d48528c3208d71d02d8d5%7C72f988bf86f141a\n> f91ab2d7cd011db47%7C1%7C0%7C637009771013658738&amp;sdata=PKPdRI0mC65Lx\n> 2J5etYnp0fyzsk%2BXSGzGBWa12BLKEE%3D&amp;reserved=0\n> \n> \"git log\" works as expected from the command prompt.  But when I execute it via C# Process class and read from Standard Output, the refs are missing.\n> \n> Is anyone familiar with this issue?  Any idea why the output to CMD and STDOUT would be different?\n\nDecorations, like color and refs pointing to a commit, are for humans, and humans read the terminal.  If the command's output doesn't go to a terminal, then no such decorations are shown by default.\n\nTry invoking 'git log --decorate'; or, better yet, use your custom '--format=', especially if you intend to parse the output, \n\n"},{"id":"380248","messageId":"BN8PR21MB11566C135B1326AF1B45E4D8B7D60@BN8PR21MB1156.namprd21.prod.outlook.com","threadId":"51614","inReplyTo":"20190809195031.GK20404@szeder.dev","subject":"RE: \"git log\" does not display refs info when executed via C# Process class on Windows","fromName":"Cliff Schomburg","fromEmail":"clisc@microsoft.com","sentAt":"2019-08-09T21:34:06Z","receivedAt":"2019-08-09T21:34:12Z","isPatch":false,"sender":{"key":"clisc@microsoft.com","avatar":null},"body":"Strangely, when I run this command:\n\nGit log origin/master --pretty=oneline --decorate -1\n\nI get the format I want from STDOUT.  However, when I try to filter it to show only the tag refs:\n\nGit log origin/master --pretty=oneline --decorate --decorate-refs=^tag* -1\n\nNo refs are returned to standard output again.  Only on the command line.\n\nDoes --decorate-refs not return to STDOUT?\n\nThanks,\nCliff\n\n-----Original Message-----\nFrom: SZEDER Gábor <szeder.dev@gmail.com> \nSent: Friday, August 9, 2019 3:51 PM\nTo: Cliff Schomburg <clisc@microsoft.com>\nCc: git@vger.kernel.org\nSubject: Re: \"git log\" does not display refs info when executed via C# Process class on Windows\n\nOn Fri, Aug 09, 2019 at 07:36:19PM +0000, Cliff Schomburg wrote:\n> I have an open Git for Windows issue here:\n> https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgith\n> ub.com%2Fgit-for-windows%2Fgit%2Fissues%2F2285&amp;data=02%7C01%7Cclis\n> c%40microsoft.com%7C17689ee8d32d48528c3208d71d02d8d5%7C72f988bf86f141a\n> f91ab2d7cd011db47%7C1%7C0%7C637009771013658738&amp;sdata=PKPdRI0mC65Lx\n> 2J5etYnp0fyzsk%2BXSGzGBWa12BLKEE%3D&amp;reserved=0\n> \n> \"git log\" works as expected from the command prompt.  But when I execute it via C# Process class and read from Standard Output, the refs are missing.\n> \n> Is anyone familiar with this issue?  Any idea why the output to CMD and STDOUT would be different?\n\nDecorations, like color and refs pointing to a commit, are for humans, and humans read the terminal.  If the command's output doesn't go to a terminal, then no such decorations are shown by default.\n\nTry invoking 'git log --decorate'; or, better yet, use your custom '--format=', especially if you intend to parse the output, \n\n"},{"id":"380249","messageId":"xmqqblwyc8l8.fsf@gitster-ct.c.googlers.com","threadId":"51614","inReplyTo":"BN8PR21MB11566C135B1326AF1B45E4D8B7D60@BN8PR21MB1156.namprd21.prod.outlook.com","subject":"Re: \"git log\" does not display refs info when executed via C# Process class on Windows","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2019-08-09T21:49:55Z","receivedAt":"2019-08-09T21:50:03Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Cliff Schomburg <clisc@microsoft.com> writes:\n\n> Strangely, when I run this command:\n>\n> Git log origin/master --pretty=oneline --decorate -1\n>\n> I get the format I want from STDOUT.  However, when I try to filter it to show only the tag refs:\n>\n> Git log origin/master --pretty=oneline --decorate --decorate-refs=^tag* -1\n>\n> No refs are returned to standard output again.  Only on the command line.\n>\n> Does --decorate-refs not return to STDOUT?\n\nIf you are asking for tags, which does not begin with a caret \"^\",\nperhaps drop \"^\" from the pattern?\n\nThe pattern is supposed to be wildmatch pattern, so it is already\nleft anchored, e.g. --decorate-refs=ag* won't find any tag.\n\n\n"},{"id":"380251","messageId":"BN8PR21MB11560DB6FA18D85672CFE8FEB7D60@BN8PR21MB1156.namprd21.prod.outlook.com","threadId":"51614","inReplyTo":"xmqqblwyc8l8.fsf@gitster-ct.c.googlers.com","subject":"RE: \"git log\" does not display refs info when executed via C# Process class on Windows","fromName":"Cliff Schomburg","fromEmail":"clisc@microsoft.com","sentAt":"2019-08-09T22:16:40Z","receivedAt":"2019-08-09T22:16:44Z","isPatch":false,"sender":{"key":"clisc@microsoft.com","avatar":null},"body":"Thanks, I will try that as well.  Strange it works on command line but not STDOUT though.\n\n-----Original Message-----\nFrom: Junio C Hamano <gitster@pobox.com> \nSent: Friday, August 9, 2019 5:50 PM\nTo: Cliff Schomburg <clisc@microsoft.com>\nCc: SZEDER Gábor <szeder.dev@gmail.com>; git@vger.kernel.org\nSubject: Re: \"git log\" does not display refs info when executed via C# Process class on Windows\n\nCliff Schomburg <clisc@microsoft.com> writes:\n\n> Strangely, when I run this command:\n>\n> Git log origin/master --pretty=oneline --decorate -1\n>\n> I get the format I want from STDOUT.  However, when I try to filter it to show only the tag refs:\n>\n> Git log origin/master --pretty=oneline --decorate \n> --decorate-refs=^tag* -1\n>\n> No refs are returned to standard output again.  Only on the command line.\n>\n> Does --decorate-refs not return to STDOUT?\n\nIf you are asking for tags, which does not begin with a caret \"^\", perhaps drop \"^\" from the pattern?\n\nThe pattern is supposed to be wildmatch pattern, so it is already left anchored, e.g. --decorate-refs=ag* won't find any tag.\n\n\n"}]}