Commit 803e705
name-rev: learn --format=<pretty>
Teach git-name-rev(1) to format the given revisions instead of creating
symbolic names.
Sometimes you want to format commits. Most of the time you’re walking
the graph, e.g. getting a range of commits like `master..topic`. That’s
a job for git-log(1).
But sometimes you might want to format commits that you encounter
on demand:
• Full hashes in running text that you might want to pretty-print
• git-last-modified(1) outputs full hashes that you can do the same with
• git-cherry(1) has `-v` for commit subject, but maybe you want
something else?
But now you can’t use git-log(1), git-show(1), or git-rev-list(1):
• You can’t feed commits piecemeal to these commands, one input for one
output; they block until standard in is closed
• You can’t feed a list of possibly duplicate commits, like the output
of git-last-modified(1); they effectively deduplicate the output
Beyond these two points there’s also the input massage problem: you
cannot feed mixed input (revisions mixed with arbitrary text).
One might hope that git-cat-file(1) can save us. But it doesn’t support
pretty formats.
But there is one command that already both handles revisions as
arguments, revisions on standard input, and even revisions mixed
in with arbitrary text. Namely git-name-rev(1).
Teach it to work in a format mode where the output for each revision is
the pretty output (implies `--name-only`). This can be used to format
any revision expression when given as arguments, and all full commit
hashes in running text on stdin.
Just bring the hashes (to the pipeline). We will pretty print them.
Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>
Signed-off-by: Junio C Hamano <gitster@pobox.com>1 parent 7fe5a5f commit 803e705
File tree
3 files changed
+198
-8
lines changed- Documentation
- builtin
- t
3 files changed
+198
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
24 | 32 | | |
25 | 33 | | |
26 | 34 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
21 | 24 | | |
22 | 25 | | |
23 | 26 | | |
| |||
33 | 36 | | |
34 | 37 | | |
35 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
36 | 49 | | |
37 | 50 | | |
38 | 51 | | |
| |||
454 | 467 | | |
455 | 468 | | |
456 | 469 | | |
457 | | - | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
458 | 473 | | |
459 | 474 | | |
460 | 475 | | |
461 | 476 | | |
462 | 477 | | |
463 | 478 | | |
464 | 479 | | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
465 | 499 | | |
466 | 500 | | |
467 | 501 | | |
| |||
479 | 513 | | |
480 | 514 | | |
481 | 515 | | |
| 516 | + | |
482 | 517 | | |
483 | 518 | | |
484 | 519 | | |
| |||
487 | 522 | | |
488 | 523 | | |
489 | 524 | | |
490 | | - | |
| 525 | + | |
491 | 526 | | |
492 | 527 | | |
493 | 528 | | |
| |||
507 | 542 | | |
508 | 543 | | |
509 | 544 | | |
510 | | - | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
511 | 548 | | |
512 | 549 | | |
513 | 550 | | |
| |||
532 | 569 | | |
533 | 570 | | |
534 | 571 | | |
535 | | - | |
| 572 | + | |
536 | 573 | | |
537 | 574 | | |
538 | 575 | | |
| |||
554 | 591 | | |
555 | 592 | | |
556 | 593 | | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
557 | 604 | | |
558 | 605 | | |
559 | 606 | | |
| |||
567 | 614 | | |
568 | 615 | | |
569 | 616 | | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
570 | 623 | | |
571 | 624 | | |
572 | 625 | | |
| |||
584 | 637 | | |
585 | 638 | | |
586 | 639 | | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
587 | 644 | | |
588 | 645 | | |
589 | 646 | | |
| |||
592 | 649 | | |
593 | 650 | | |
594 | 651 | | |
| 652 | + | |
| 653 | + | |
595 | 654 | | |
596 | 655 | | |
597 | 656 | | |
| |||
606 | 665 | | |
607 | 666 | | |
608 | 667 | | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
609 | 693 | | |
610 | 694 | | |
611 | 695 | | |
| |||
663 | 747 | | |
664 | 748 | | |
665 | 749 | | |
666 | | - | |
| 750 | + | |
667 | 751 | | |
668 | 752 | | |
669 | 753 | | |
| |||
674 | 758 | | |
675 | 759 | | |
676 | 760 | | |
677 | | - | |
| 761 | + | |
678 | 762 | | |
679 | 763 | | |
680 | 764 | | |
681 | 765 | | |
682 | 766 | | |
683 | | - | |
| 767 | + | |
684 | 768 | | |
685 | 769 | | |
686 | 770 | | |
687 | 771 | | |
688 | 772 | | |
| 773 | + | |
| 774 | + | |
689 | 775 | | |
690 | 776 | | |
691 | 777 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
658 | 658 | | |
659 | 659 | | |
660 | 660 | | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
661 | 757 | | |
662 | 758 | | |
663 | 759 | | |
| |||
0 commit comments