This commit is contained in:
parent
af4e13d6e8
commit
39944ed35d
|
@ -134,7 +134,7 @@ branch.
|
||||||
#### Fixup, a practical example
|
#### Fixup, a practical example
|
||||||
|
|
||||||
A specific kind of squashing which I use frequently is the notion of `fixup`s.
|
A specific kind of squashing which I use frequently is the notion of `fixup`s.
|
||||||
Say you've commited a change (*A*), and later on notice that it is missing
|
Say you've committed a change (*A*), and later on notice that it is missing
|
||||||
a part of the changeset. You can decide to commit that missing part (*A-bis*)
|
a part of the changeset. You can decide to commit that missing part (*A-bis*)
|
||||||
and annotate it to mean that it is linked to *A*.
|
and annotate it to mean that it is linked to *A*.
|
||||||
|
|
||||||
|
@ -184,7 +184,7 @@ After applying the rebase, you find yourself with the complete change inside
|
||||||
|
|
||||||
This is especially useful when you want to apply suggestion on a merge request
|
This is especially useful when you want to apply suggestion on a merge request
|
||||||
after it was reviewed. You can keep a clean history without those pesky `Apply
|
after it was reviewed. You can keep a clean history without those pesky `Apply
|
||||||
suggestion ...` commmits being part of your history.
|
suggestion ...` commits being part of your history.
|
||||||
|
|
||||||
### Lost commits and the reflog
|
### Lost commits and the reflog
|
||||||
|
|
||||||
|
|
|
@ -261,7 +261,7 @@ this new `SpaceStation` variant at every point you `visit` the `SpaceObject`s.
|
||||||
|
|
||||||
## The Expression Problem
|
## The Expression Problem
|
||||||
|
|
||||||
One issue we have not been able to move past in these exemples is the
|
One issue we have not been able to move past in these examples is the
|
||||||
[Expression Problem][expression-problem]. In two words, this means that we can't
|
[Expression Problem][expression-problem]. In two words, this means that we can't
|
||||||
add a new data type (e.g: `SpaceStation`), or a new operation (e.g: `land_on`)
|
add a new data type (e.g: `SpaceStation`), or a new operation (e.g: `land_on`)
|
||||||
to our current code without re-compiling it.
|
to our current code without re-compiling it.
|
||||||
|
|
|
@ -133,7 +133,7 @@ and moving the start of the gap further right.
|
||||||
|
|
||||||
```python
|
```python
|
||||||
def insert(self, val: str) -> None:
|
def insert(self, val: str) -> None:
|
||||||
# Ensure we have enouh space to insert the whole string
|
# Ensure we have enough space to insert the whole string
|
||||||
if len(val) > self.gap_length:
|
if len(val) > self.gap_length:
|
||||||
self.grow(max(self.capacity * 2, self.string_length + len(val)))
|
self.grow(max(self.capacity * 2, self.string_length + len(val)))
|
||||||
# Fill the gap with the given string
|
# Fill the gap with the given string
|
||||||
|
@ -163,7 +163,7 @@ def delete(self, dist: int = 1) -> None:
|
||||||
### Moving the cursor
|
### Moving the cursor
|
||||||
|
|
||||||
Moving the cursor along the buffer will shift letters from one side of the gap
|
Moving the cursor along the buffer will shift letters from one side of the gap
|
||||||
to the other, moving them accross from prefix to suffix and back.
|
to the other, moving them across from prefix to suffix and back.
|
||||||
|
|
||||||
I find Python's list slicing not quite as elegant to read as a `memmove`, though
|
I find Python's list slicing not quite as elegant to read as a `memmove`, though
|
||||||
it does make for a very small and efficient implementation.
|
it does make for a very small and efficient implementation.
|
||||||
|
|
Loading…
Reference in a new issue