Formats/PowerGit.CommitInfo.formats.ps1xml

<?xml version="1.0" encoding="utf-8"?>
<!--
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<Configuration>
    <ViewDefinitions>
        <!-- Resembles the git log output with format=medium (default) -->
        <View>
            <Name>Medium</Name>
            <ViewSelectedBy>
                <TypeName>PowerGit.CommitInfo</TypeName>
            </ViewSelectedBy>
            <ListControl>
                <ListEntries>
                    <ListEntry>
                        <ListItems>
                            <ListItem>
                                <!-- Yellow -->
                                <Label>&#27;[33mSha</Label>
                                <ScriptBlock>"$($_.Sha)$([char]0x001b)[0m"</ScriptBlock>
                            </ListItem>
                            <ListItem>
                                <Label>Author</Label>
                                <PropertyName>Author</PropertyName>
                            </ListItem>
                            <ListItem>
                                <Label>Date</Label>
                                <ScriptBlock>"$($_.Author.When)"</ScriptBlock>
                            </ListItem>
                            <ListItem>
                                <Label>Message</Label>
                                <PropertyName>Message</PropertyName>
                            </ListItem>
                            <ListItem>
                                <Label>Patch</Label>
                                <ScriptBlock>$_.Patch | ConvertTo-ColoredPatch</ScriptBlock>
                                <ItemSelectionCondition>
                                    <PropertyName>Patch</PropertyName>
                                </ItemSelectionCondition>
                            </ListItem>
                        </ListItems>
                    </ListEntry>
                </ListEntries>
            </ListControl>
        </View>
        <!-- Resembles the git log output with format=full -->
        <View>
            <Name>Full</Name>
            <ViewSelectedBy>
                <TypeName>PowerGit.CommitInfo</TypeName>
            </ViewSelectedBy>
            <ListControl>
                <ListEntries>
                    <ListEntry>
                        <ListItems>
                            <ListItem>
                                <!-- Yellow -->
                                <Label>&#27;[33mSha</Label>
                                <ScriptBlock>"$($_.Sha)$([char]0x001b)[0m"</ScriptBlock>
                            </ListItem>
                            <ListItem>
                                <Label>Author</Label>
                                <PropertyName>Author</PropertyName>
                            </ListItem>
                            <ListItem>
                                <Label>Committer</Label>
                                <PropertyName>Committer</PropertyName>
                            </ListItem>
                            <ListItem>
                                <Label>Message</Label>
                                <PropertyName>Message</PropertyName>
                            </ListItem>
                            <ListItem>
                                <Label>Patch</Label>
                                <ScriptBlock>$_.Patch | ConvertTo-ColoredPatch</ScriptBlock>
                                <ItemSelectionCondition>
                                    <PropertyName>Patch</PropertyName>
                                </ItemSelectionCondition>
                            </ListItem>
                        </ListItems>
                    </ListEntry>
                </ListEntries>
            </ListControl>
        </View>
        <!-- Resembles the default git log output with format=fuller -->
        <View>
            <Name>Fuller</Name>
            <ViewSelectedBy>
                <TypeName>PowerGit.CommitInfo</TypeName>
            </ViewSelectedBy>
            <ListControl>
                <ListEntries>
                    <ListEntry>
                        <ListItems>
                            <ListItem>
                                <!-- Yellow -->
                                <Label>&#27;[33mSha</Label>
                                <ScriptBlock>"$($_.Sha)$([char]0x001b)[0m"</ScriptBlock>
                            </ListItem>
                            <ListItem>
                                <Label>Author</Label>
                                <PropertyName>Author</PropertyName>
                            </ListItem>
                            <ListItem>
                                <Label>AuthorDate</Label>
                                <ScriptBlock>$_.Author.When</ScriptBlock>
                            </ListItem>
                            <ListItem>
                                <Label>Committer</Label>
                                <PropertyName>Committer</PropertyName>
                            </ListItem>
                            <ListItem>
                                <Label>CommitterDate</Label>
                                <ScriptBlock>$_.Committer.When</ScriptBlock>
                            </ListItem>
                            <ListItem>
                                <Label>Message</Label>
                                <PropertyName>Message</PropertyName>
                            </ListItem>
                            <ListItem>
                                <Label>Patch</Label>
                                <ScriptBlock>$_.Patch | ConvertTo-ColoredPatch</ScriptBlock>
                                <ItemSelectionCondition>
                                    <PropertyName>Patch</PropertyName>
                                </ItemSelectionCondition>
                            </ListItem>
                        </ListItems>
                    </ListEntry>
                </ListEntries>
            </ListControl>
        </View>
        <!-- Resembles the git log output with format=oneline -->
        <View>
            <Name>Oneline</Name>
            <ViewSelectedBy>
                <TypeName>PowerGit.CommitInfo</TypeName>
            </ViewSelectedBy>
            <TableControl>
                <AutoSize/>
                <TableHeaders>
                    <TableColumnHeader>
                        <Label>Sha</Label>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Label>Message</Label>
                    </TableColumnHeader>
                </TableHeaders>
                <TableRowEntries>
                    <TableRowEntry>
                        <TableColumnItems>
                            <TableColumnItem>
                                <!-- Yellow -->
                                <ScriptBlock>"$([char]0x001b)[33m$($_.Sha.Substring(0, 7))$([char]0x001b)[0m"</ScriptBlock>
                            </TableColumnItem>
                            <TableColumnItem>
                                <PropertyName>MessageShort</PropertyName>
                            </TableColumnItem>
                        </TableColumnItems>
                    </TableRowEntry>
                </TableRowEntries>
            </TableControl>
        </View>
    </ViewDefinitions>
</Configuration>