Fossil SCM

Merged the new commit splitting material in gitusers.md into the "There Is No Staging Area" section, which covers similar things. Now referring to this new version from the old location under the rebase topic.

wyoung 2020-12-10 22:49 trunk
Commit 6369d7b31c9e79e104f72f9b643aa812923e11d41962ea69872555347fd4553b
1 file changed +43 -26
+43 -26
--- www/gitusers.md
+++ www/gitusers.md
@@ -467,14 +467,50 @@
467467
If you only want to commit _some_ of the changes, list the names
468468
of the files or directories you want to commit as arguments, like this:
469469
470470
fossil commit src/feature.c doc/feature.md examples/feature
471471
472
-There are currently no interactive patching features in Fossil like
473
-`git add --patch/-p` or `git commit -p`. [Contributions welcome!][ctrb]
472
+Although there are currently no
473
+<a id="csplit"></a>[commit splitting][gcspl] features in Fossil like
474
+`git add -p`, `git commit -p`, or `git rebase -i`, you can get the same
475
+effect by converting an uncommitted change set to a patch and then
476
+running it through [Patchouli].
474477
475
-[ctrb]: https://fossil-scm.org/fossil/doc/trunk/www/contribute.wiki
478
+Rather than use `fossil diff -i` to produce such a patch, a safer and
479
+more idiomatic method would be:
480
+
481
+ fossil stash save -m 'my big ball-o-hackage'
482
+ fossil stash diff > my-changes.patch
483
+
484
+That stores your changes in the stash, then lets you operate on a copy
485
+of that patch. Each time you re-run the second command, it will take the
486
+current state of the working directory into account to produce a
487
+potentially different patch, likely smaller because it leaves out patch
488
+hunks already applied.
489
+
490
+In this way, the combination of working tree and stash replaces the need
491
+for Git’s index feature.
492
+
493
+This also solves a philosophical problem with `git commit -p`: how can
494
+you test that a split commit doesn’t break anything if you do it as part
495
+of the commit action? Git’s lack of an autosync feature means you can
496
+commit locally and then rewrite history if the commit doesn’t work out,
497
+but we’d rather make changes only to the working directory, test the
498
+changes there, and only commit once we’re sure it’s right.
499
+
500
+This also explains why we don’t have anything like `git rebase -i`
501
+to split an existing commit: in Fossil, commits are *commitments,* not
502
+something you want to go back and rewrite later.
503
+
504
+If someone does [contribute][ctrb] a commit splitting feature to Fossil,
505
+we’d expect it to be an interactive form of
506
+[`fossil stash apply`][stash], rather than follow Git’s ill-considered
507
+design leads.
508
+
509
+[ctrb]: https://fossil-scm.org/fossil/doc/trunk/www/contribute.wiki
510
+[gcspl]: https://git-scm.com/docs/git-rebase#_splitting_commits
511
+[Patchouli]: https://pypi.org/project/patchouli/
476512
477513
478514
<a id="bneed"></a>
479515
## Create Branches At Point Of Need, Rather Than Ahead of Need
480516
@@ -632,34 +668,15 @@
632668
draft was written, it’s been revised multiple times to address less
633669
common objections as well. Chances are not good that you are going to
634670
come up with a new objection that we haven’t already considered and
635671
addressed there.
636672
673
+There is only one sub-feature of `git rebase` that is philosophically
674
+compatible with Fossil yet which currently has no functional equivalent.
675
+We cover [this and the workaround for it](#csplit) above.
676
+
637677
[3]: ./rebaseharm.md
638
-
639
-
640
-## <a id="split"></a> Commit Splitting
641
-
642
-Although Fossil is [highly unlikely to get rebasing](#rebase), there is
643
-one sub-feature of `git rebase` that currently has no functional
644
-equivalent in Fossil yet which is philosophically compatible with it:
645
-[commit splitting][gcspl].
646
-
647
-We’ve discussed designs for getting such a feature in Fossil without
648
-resorting to the history-rewriting features of `git rebase`, such as an
649
-interactive form of [`fossil stash apply`][stash]. Until someone gets
650
-around to providing such a feature, we suggest that you try [Patchouli].
651
-
652
-To contrast this with `git rebase -i`, you don’t commit a large change
653
-set and then rewrite history to split it up, you produce a patch file
654
-(`fossil diff -i > my-changes.patch`) and then apply a subset of those
655
-changes to the Fossil working tree, test the result, and commit.
656
-
657
-[gcspl]: https://git-scm.com/docs/git-rebase#_splitting_commits
658
-[Patchouli]: https://pypi.org/project/patchouli/
659
-
660
-
661678
662679
663680
## <a id="show"></a> Showing Information About Commits
664681
665682
While there is no direct equivalent to Git’s “`show`” command, similar
666683
--- www/gitusers.md
+++ www/gitusers.md
@@ -467,14 +467,50 @@
467 If you only want to commit _some_ of the changes, list the names
468 of the files or directories you want to commit as arguments, like this:
469
470 fossil commit src/feature.c doc/feature.md examples/feature
471
472 There are currently no interactive patching features in Fossil like
473 `git add --patch/-p` or `git commit -p`. [Contributions welcome!][ctrb]
 
 
 
474
475 [ctrb]: https://fossil-scm.org/fossil/doc/trunk/www/contribute.wiki
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
476
477
478 <a id="bneed"></a>
479 ## Create Branches At Point Of Need, Rather Than Ahead of Need
480
@@ -632,34 +668,15 @@
632 draft was written, it’s been revised multiple times to address less
633 common objections as well. Chances are not good that you are going to
634 come up with a new objection that we haven’t already considered and
635 addressed there.
636
 
 
 
 
637 [3]: ./rebaseharm.md
638
639
640 ## <a id="split"></a> Commit Splitting
641
642 Although Fossil is [highly unlikely to get rebasing](#rebase), there is
643 one sub-feature of `git rebase` that currently has no functional
644 equivalent in Fossil yet which is philosophically compatible with it:
645 [commit splitting][gcspl].
646
647 We’ve discussed designs for getting such a feature in Fossil without
648 resorting to the history-rewriting features of `git rebase`, such as an
649 interactive form of [`fossil stash apply`][stash]. Until someone gets
650 around to providing such a feature, we suggest that you try [Patchouli].
651
652 To contrast this with `git rebase -i`, you don’t commit a large change
653 set and then rewrite history to split it up, you produce a patch file
654 (`fossil diff -i > my-changes.patch`) and then apply a subset of those
655 changes to the Fossil working tree, test the result, and commit.
656
657 [gcspl]: https://git-scm.com/docs/git-rebase#_splitting_commits
658 [Patchouli]: https://pypi.org/project/patchouli/
659
660
661
662
663 ## <a id="show"></a> Showing Information About Commits
664
665 While there is no direct equivalent to Git’s “`show`” command, similar
666
--- www/gitusers.md
+++ www/gitusers.md
@@ -467,14 +467,50 @@
467 If you only want to commit _some_ of the changes, list the names
468 of the files or directories you want to commit as arguments, like this:
469
470 fossil commit src/feature.c doc/feature.md examples/feature
471
472 Although there are currently no
473 <a id="csplit"></a>[commit splitting][gcspl] features in Fossil like
474 `git add -p`, `git commit -p`, or `git rebase -i`, you can get the same
475 effect by converting an uncommitted change set to a patch and then
476 running it through [Patchouli].
477
478 Rather than use `fossil diff -i` to produce such a patch, a safer and
479 more idiomatic method would be:
480
481 fossil stash save -m 'my big ball-o-hackage'
482 fossil stash diff > my-changes.patch
483
484 That stores your changes in the stash, then lets you operate on a copy
485 of that patch. Each time you re-run the second command, it will take the
486 current state of the working directory into account to produce a
487 potentially different patch, likely smaller because it leaves out patch
488 hunks already applied.
489
490 In this way, the combination of working tree and stash replaces the need
491 for Git’s index feature.
492
493 This also solves a philosophical problem with `git commit -p`: how can
494 you test that a split commit doesn’t break anything if you do it as part
495 of the commit action? Git’s lack of an autosync feature means you can
496 commit locally and then rewrite history if the commit doesn’t work out,
497 but we’d rather make changes only to the working directory, test the
498 changes there, and only commit once we’re sure it’s right.
499
500 This also explains why we don’t have anything like `git rebase -i`
501 to split an existing commit: in Fossil, commits are *commitments,* not
502 something you want to go back and rewrite later.
503
504 If someone does [contribute][ctrb] a commit splitting feature to Fossil,
505 we’d expect it to be an interactive form of
506 [`fossil stash apply`][stash], rather than follow Git’s ill-considered
507 design leads.
508
509 [ctrb]: https://fossil-scm.org/fossil/doc/trunk/www/contribute.wiki
510 [gcspl]: https://git-scm.com/docs/git-rebase#_splitting_commits
511 [Patchouli]: https://pypi.org/project/patchouli/
512
513
514 <a id="bneed"></a>
515 ## Create Branches At Point Of Need, Rather Than Ahead of Need
516
@@ -632,34 +668,15 @@
668 draft was written, it’s been revised multiple times to address less
669 common objections as well. Chances are not good that you are going to
670 come up with a new objection that we haven’t already considered and
671 addressed there.
672
673 There is only one sub-feature of `git rebase` that is philosophically
674 compatible with Fossil yet which currently has no functional equivalent.
675 We cover [this and the workaround for it](#csplit) above.
676
677 [3]: ./rebaseharm.md
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
678
679
680 ## <a id="show"></a> Showing Information About Commits
681
682 While there is no direct equivalent to Git’s “`show`” command, similar
683

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button