Skip to content

Git up doesn't (always) work with pretty log format #11

Closed
@valentijnscholten

Description

@valentijnscholten

Hello,

I am not 100% sure this is a git up issue (I am relatively new to git and git up).

When I create a git alias to allow me to do a pretty log format:

git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"

This works and gives me nice output.

When I try to set this log command as rebase log hook in git up:

git config --global git-up.rebase.log-hook "git log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"

This doesn't work:

c:\Data\kpn-ritesim>git up
Fetching origin
master  fast-forwarding...
Het systeem kan het opgegeven bestand niet vinden.

(This is actually a error message in Dutch, in English it's "File or command not found")

I was supecting it had someting to do with the ' character and I tried different alternatives:

git config --global git-up.rebase.log-hook "git log --color --graph --pretty=format:\'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset\' --abbrev-commit"

Same result.

git config --global git-up.rebase.log-hook "git log --color --graph --pretty=format:\"%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset\" --abbrev-commit"

This command itself cannot be executed (throws the same error).

Since the git alias is working and the git up rebase hook isn't, could it be related to how git up executes the hook?

If I use a simpler git log command, it does work:

git config --global git-up.rebase.log-hook "echo \"changes on $1:\"; git log --oneline --decorate $1..$2"

I am on windows 7 x64.

Valentijn

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions