1

I often use the windows console called console2 and recently found PowerCmd, so I have been trying it out.

I create a Git repository and make and commit three changes. First the correct log in console2:

c:\code\junk>git log --pretty=oneline
015cfbec12208d7b719d523c92d0c46b726d42e6 third time lucky.
c8a9ffeb4381cd515a62937a0a50b7dc5360dbb8 Second commit
370e9cbb72feca9fb784843154f2171fefe2c656 initial commit

I get double the goodness using PowerCmd:

C:\code\junk>git log --pretty=oneline
[33m015cfbec12208d7b719d523c92d0c46b726d42e6[m third time lucky.
[33mc8a9ffeb4381cd515a62937a0a50b7dc5360dbb8[m Second commit
[33m370e9cbb72feca9fb784843154f2171fefe2c656[m initial commit
015cfbec12208d7b719d523c92d0c46b726d42e6 third time lucky.
c8a9ffeb4381cd515a62937a0a50b7dc5360dbb8 Second commit
370e9cbb72feca9fb784843154f2171fefe2c656 initial commit

Any body know whats up?

EDIT: Tried a suggestion --no-color and ....

C:\code\junk>git log --pretty=oneline --no-color
015cfbec12208d7b719d523c92d0c46b726d42e6 third time lucky.
c8a9ffeb4381cd515a62937a0a50b7dc5360dbb8 Second commit
370e9cbb72feca9fb784843154f2171fefe2c656 initial commit
015cfbec12208d7b719d523c92d0c46b726d42e6 third time lucky.
c8a9ffeb4381cd515a62937a0a50b7dc5360dbb8 Second commit
370e9cbb72feca9fb784843154f2171fefe2c656 initial commit

Too funny! I like PowerCmd, maybe just not for git.

rtfminc
  • 6,243
  • 7
  • 36
  • 45

1 Answers1

2

Those are ANSI escape sequence (for ANSI colors), and PowerCmd doesn't seem to support them (as mentioned in this thread)

You can try:

git log --no-color

That would allow you to check if there still is duplicate commits when you ask for no color.

I checked: the output is always doubled, even when I set TERM=msys

The only way I got it to behave is by redirecting stdout to a dummy text (not NUL, but an actual dummy file)

C:\Users\vonc\prog\git\git>git log -2 --no-color --oneline >dummy
f82887f Git 2.1-rc2
764c739 Merge branch 'mb/relnotes-2.1'
Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • I tried that, and it didn't work - it makes me think that its trying to do something else - I just don't know what! – rtfminc Aug 16 '14 at 07:41
  • >git --version git version 1.9.4.msysgit.1 – rtfminc Aug 17 '14 at 01:41
  • @rtfminc I just tested Powercmd, and the issue is there. I have found one way to get only one output (instead of two), but the workaround isn't very practical. See my edited answer. – VonC Aug 17 '14 at 05:43
  • yes, the workaround works. Glad it wasn't me, I had TortoiseGit installed and removed it and the msysgit installed and reloaded it. Thanks for pinpointing the problem, I like having things figured out. :) – rtfminc Aug 17 '14 at 06:27