Pārlūkot izejas kodu

Update Git and PTP notes

Håvard Ose Nordstrand 1 gadu atpakaļ
vecāks
revīzija
701e07819a
2 mainītis faili ar 36 papildinājumiem un 7 dzēšanām
  1. 15 1
      networking/ptp.md
  2. 21 6
      soft-eng/git.md

+ 15 - 1
networking/ptp.md

@@ -85,11 +85,12 @@ breadcrumbs:
     - Use priority 1 to choose the primary GMC.
     - Connect the backup GMC to an Ethernet switch at most one bridge hop away from the primary. This yealds lower PDV changes in case of failovers.
 
-### Versions
+### Versions and Amendments
 
 #### PTPv1 (IEEE 1588-2002)
 
 - The initial version, designed to give greater precision than NTP by using GPS.
+- The full name is "Standard for a Precision Clock Synchronization Protocol for Networked Measurement and Control Systems" (SPCSPNMCS?).
 - Used e.g. by older Dante devices.
 
 #### PTPv2 (IEEE 1588-2008)
@@ -101,6 +102,19 @@ breadcrumbs:
 
 - Includes some backwards-compatible improvements to the 2008 version.
 
+#### IEEE 1588g-2022 (IEEE Std 1588-2019 Amendment)
+
+- Introduces alternative terminology for master and slave.
+- New terms:
+    - Master: Time transmitter (TT)
+    - Slave: Time receiver (TR)
+    - Grandmaster: Grandmaster (GM) (unchanged)
+    - BMCA: BTCA
+
+#### IEEE 1588e-2024 (IEEE Std 1588-2019 Amendment)
+
+- Identifies structure and content of the IEEE 1588 MIB and YANG modules.
+
 ### PTPv2 Profiles
 
 #### Default (IEEE 1588-2008)

+ 21 - 6
soft-eng/git.md

@@ -46,12 +46,19 @@ breadcrumbs:
             - "docs: correct spelling of CHANGELOG"
             - "feat(lang): add Norwegian language"
     - For squash based workflows, lead maintainers can clean up the commit messages when they're merged, so that the "casual contributer" doesn't need to conform exactly to the commit message rules.
+- Big repo enhancements:
+    - Windows has contributed a lot here since they moved Windows to git. They have approximately 3.5M files in a 300GB repo, used by 4000 engineers (2024). Most of the features were added through the Scalar project, but it's now mostly available in the Git core.
 
 ## Commands
 
 - General:
-    - Clone a repo using SSH (GitHub HON95/wiki example): `git clone git@github.com:HON95/wiki.git [local-dir]`
     - Check the status: `git status`
+    - Update local config and add cron job to update/cleanup repo stuff in the background: `git maintenance start`
+    - Show reflog: `git reflog`
+- Cloning:
+    - Clone a repo using SSH (GitHub HON95/wiki example): `git clone git@github.com:HON95/wiki.git [local-dir]`
+    - Partial clone without blobs (for big repos, will fetch them on demand): `git clone --filter=blob:none <...>`
+    - Partial clone without trees (for big repos, rarely used, maybe for CI): `git clone --filter=tree:0 <...>`
 - Staging files:
     - Add all files: `git add -A`
     - Unstage all files (without changing them): `git reset`
@@ -77,16 +84,19 @@ breadcrumbs:
     - Force push, but only if the remote hasn't changed (less dangerous): `git push --force-with-lease`
 - Branching:
     - Edit the description of a branch: `git branch --edit-description [branchname]` (defaults to active branch)
+    - Sparse checkout (limit locally present dirs, assume others are unchanged): `git sparse-checkout set <dir ...>`
 - Stashing:
     - **TODO**
 - Diffing:
     - Show diff between unstaged changes and staged/HEAD: `git diff [file]`
+    - Show diff for a commit: `git diff <commit-hash>~ <commit-hash>`
     - Show diffs within a line as diffs within a line: `git diff --word-diff`
 - Log searching:
     - Show log for repo: `git log`
     - Show log for file: `git log <file>`
     - Show log as patch text: `git log -p`
     - Search log for when something changed: `git log -G <regex> -p`
+    - Show log with graph (show branching and merging): `git log --graph --oneline`
 - Blaming:
     - Blame for a section of lines: `git blame -L <start-line>,<stop-line> <file>`
     - Check history for a section of lines: `git log -L <start-line>,<stop-line>:<file>` (note the `:`)
@@ -98,21 +108,23 @@ breadcrumbs:
         - ... or in any commit at all (slow): `git blame -C -C -C <...>`
 - Submodules:
     - **TODO**
-- Backgroun maintenance tasks:
-    - Update local config and add cron job to update/cleanup repo stuff in the background: `git maintenance start`
 - Config:
     - Se section below.
     - Update global config: `git config --global <key> <value>`
-- Miscellanea:
-    - Show reflog: `git reflog`
 
 ## Config
 
 - Conditional configs:
     - Use `[includeIf <condition>]` sections with a `path = <config-path>` statement to conditionally include the config at the target path.
     - Example: Use `[includeIf "gitdir:~/projects/work/"]` plus `path = ~/projects/work/.gitconfig` to use the work git config for work projects, e.g. to change the email address or SSH keys.
+- Project config:
+    - Enable filesystem monitor for git status (for big repos):
+        - `git config core.untrackedcache true`
+        - `git config core.fsmonitor true`
+
+### Example Global Config
 
-### Example Config
+`~/.gitconfig`
 
 ```ini
 [user]
@@ -121,6 +133,9 @@ breadcrumbs:
 [core]
         # Convert CRLF to LF
         autocrlf = input
+[fetch]
+        # Write commit-graph cache
+        writeCommitGraph = true
 [commit]
         # Don't auto-sign, use it selectively instead
         gpgsign = false