Skip to content

Support inline stdin redirect #2

@b1f6c1c4

Description

@b1f6c1c4

In sh we can do the following:

echo 'Merge branch doc' | git commit-tree $(git write-tree) -p HEAD -p doc > thecommithash
git reset --soft $(cat thecommithash)
rm -f thecommithash

In PowerShell the following works, but thecommithash has strange encoding:

echo 'Merge branch doc' | git commit-tree $(git write-tree) -p HEAD -p doc > thecommithash
git reset --soft $(cat thecommithash)
rm -fo thecommithash

To take the benefit of Use-RawPipeline, it'd be better to have echo2:

echo2 'Merge branch doc' | run git commit-tree $(git write-tree) -p HEAD -p doc | out2 thecommithash
git reset --soft $(cat thecommithash)
rm -fo thecommithash

Basically, echo2, compared with stdin, should create a raw pipeline stdin from its arguments literally, instead of files specified by the arguments.

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