Table des matières
- 2026:
- 2025:
1 billet(s) pour avril 2026
| Notes ping ICMP | 2026/04/03 23:01 | Jean-Baptiste |
Notes git bisect
Voir aussi :
source : https://opensource.com/article/22/11/git-bisect
Using Git bisect Using the git bisect command is very straightforward:
git bisect start git bisect bad # Git assumes you mean HEAD by default git bisect good <ref> # specify a tag or commit ID for <ref>
Git checks out the commit in the middle and waits for you to declare either:
git bisect good ## or git bisect bad
Then the bisect tool repeats checking out the commit halfway between good and bad commits until you tell it:
git bisect reset
Advanced users can even write scripts that determine good and bad states as well as any remediation actions to take upon finding the specific commit. You might not use the git bisect command every day of your life, but when you need it, it is a lifesaver.
Notes Git Annex
Blog
Chiffrement
Autre
Synchro automatique avec git annex assistant
Le fichier ~/.config/git-annex/autostart contient la liste des dépôts a synchroniser
~/.config/git-annex/autostart
/home/jean/annex2 /home/jean/annex
git annex dead usbdrive git annex semitrust usbdrive git annex add $file git annex merge git annex sync git annex sync --content git annex copy $file --to otherrepo git annex numcopies 2 git annex drop . --from cloud git annex forget --drop-dead
Centralisé
https://git-annex.branchable.com/tips/centralized_git_repository_tutorial/
On the server I did:
git init --bare git annex init origin
On Cĺient Alice (I want to give Bob a chance get call “git annex get” from “origin”):
git clone ssh://tktest@192.168.56.104/~/annex . git annex init Alice git annex merge git annex add . git commit -a -m "Added tutorial" git push origin master git-annex git annex copy . --to origin
git annex initremote myrsync type=rsync rsyncurl=ssh.example.com:/myrsync keyid=id@joeyh.name encryption=pubkey keyid=KEYID git annex describe myrsync “rsync server” git annex enableremote myrsync
git annex enableremote myrsync keyid+=788A3F4C
git annex testremote myrsync
Désactiver temporairement git config remote.myrsync.annex-ignore false
git annex unused --from myrsync git annex dropunused --from myrsync 1
Décontralisé
Sur toutes les machines mkdir ~/annex cd ~/annex git init git annex init “$HOSTNAME $PWD” git annex add .
cd ~/annex git remote add machine1 user@machine1:annex
git annex get .
Exemple
git annex add fic git annex get fic git rm fic git annex drop fic git mv fic1 fic1.old
git annex sync
git annex unlock my_cool_big_file
git annex unused git annex fsck
Delete all the copies method
Source http://git-annex.branchable.com/tips/deleting_unwanted_files/
git annex drop --force file git annex whereis file git annex drop --force file --from $repo rm file; git annex sync
Si Pb de performance
git repack -ad git gc
Si le git status est long
git config core.ignoreStat true
Métadonnées remote.log uuid.log
Voir
git show git-annex:remote.log git cat-file -p git-annex:remote.log
Editer / Modifier l'object blob de git (remote.log ou uuid.log)
export EDITOR=vim git replace --edit git-annex:remote.log
Pour voir les métadonnées associé à un fichier
git annex metadata fichier
Mode direct
Passer en mode Direct
En mode Direct les fichiers sont directement modifiables
git annex direct
Puis, si l'historique des versions est importante alors il convient de marquer ce dépôt à “untrust”. Comme la modification en écriture est activée et que un git annex sync fera un “commit”
git annex untrust .
A tout moment nous pouvons repasser en mode Indirect (pour utiliser les commandes Git, par exemple)
git annex indirect
Pour modifier un fichier en mode Indirect
git annex unlock fichier
En mode Direct, les commandes git peuvent être utilisées grâce à la commande préfixe git annex proxy
git annex undo file
Gestion de la confiance
semitrust (défaut), untrust, trust, dead
git annex untrusted [Dépôt]
Exemple :
git annex untrusted .
--trust pas être utilisé comme option
Configuration
http://git-annex.branchable.com/backends/
.gitattributes
*.mp4 annex.backend=MD5E *.webm annex.backend=MD5E *.flv annex.backend=MD5E *.3gp annex.backend=MD5E *.mov annex.backend=MD5E *.mkv annex.backend=MD5E *.divx annex.backend=MD5E *.avi annex.backend=MD5E *.zip annex.backend=MD5E *.iso annex.backend=MD5E *.webm annex.numcopies=1
Note : à faire avant le git annex init ou voir git annex migrate si changement du backend (Fonction de hachage, içi MD5E)
Modifier la conf
git annex vicfg
Pb
$ git annex fsck --from=myspecialremote gpg: can't query passphrase in batch mode gpg: decryption failed: secret key not available
Solution
eval $(gpg-agent --daemon)
Si pas d’interface graphique
export GPG_TTY=$(tty)
Information pour debug
git-annex list git-annex whereis FICHIER git-annex info REMOTE git annex get . --from REMOTE --debug git annex fsck --from REMOTE
git annex unused
git annex test
Si un “special remote” a été décommissionné
git annex drop . --from cloud --force git remote remove cloud
Notes git - Remove the secret
Remove the secret Remove a blocked secret to allow the commit to be pushed to GitLab. The method of removing the secret depends on how recently it was committed. The instructions below use the Git CLI client, but you can achieve the same result by using another Git client.
If the blocked secret was added with the most recent commit on your branch
- Remove the secrets from the files.
- Stage the changes with
git add < file-name >. - Modify the most recent commit to include the changed files with
git commit --amend. - Push your changes with
git push.
If the blocked secret appears earlier in your Git history
- Optional. Watch a short demo of removing secrets from your commits.
- Identify the commit SHA from the push error message. If there are multiple, find the earliest using
git log. - Create a copy branch to work from with
git switch --create copy-branchso you can reset to the original branch if the rebase encounters issues. - Use
git rebase -i <commit-sha>~1to start an interactive rebase. - Mark the offending commits for editing by changing the pick command to edit in the editor.
- Remove the secrets from the files.
- Stage the changes with
git add < file-name >. - Commit the changed files with
git commit --amend. - Continue the rebase with git rebase --continue until all secrets are removed.
- Push your changes from the copy branch to your original remote branch with
git push --force --set-upstream origin copy-branch:<original-branch>. - When you are satisfied with the changes, consider the following optional cleanup steps.
- Optional. Delete the original branch with
git branch --delete --force <original-branch>. - Optional. Replace the original branch by renaming the copy branch with
git branch --move copy-branch <original-branch>.
Notes git - Convention commit - Bien nommer ses commits
Voir :
Voir :
Type
Must be one of the following:
- feat: A new feature
- fix: A bug fix
- docs: Documentation only changes
- style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
- refactor: A code change that neither fixes a bug nor adds a feature
- perf: A code change that improves performance
- test: Adding missing or correcting existing tests
- chore: Changes to the build process or auxiliary tools and libraries such as documentation generation
Voir : 11 tips for writing a good Git commit message
https://github.com/cisagov/development-guide
Voir aussi :
Pull request example
Type of change
- Patch fixing an issue (non-breaking change)
- New functionality (non-breaking change)
- Functionality enhancement or optimization (non-breaking change)
- Breaking change (patch or feature) that might cause side effects breaking part of the Software
Checklist
- I have followed the coding style guidelines provided by Centreon
- I have commented my code, especially hard-to-understand areas of the PR.
- I have rebased my development branch on the base branch (develop).
- I have provide data or shown output displaying the result of this code in the plugin area concerned.
Type of change
- Patch fixing an issue (non-breaking change)
- New functionality (non-breaking change)
- Functionality enhancement or optimization (non-breaking change)
- Breaking change (patch or feature) that might cause side effects breaking part of the Software
Checklist
- I have followed the coding style guidelines provided by Centreon
- I have commented my code, especially hard-to-understand areas of the PR.
- I have rebased my development branch on the base branch (develop).
- In case of a new plugin, I have created the new packaging directory accordingly.
- I have implemented automated tests related to my commits.
- Data used for automated tests are anonymized.
- I have reviewed all the help messages in all the .pm files I have modified.
- All sentences begin with a capital letter.
- All sentences end with a period.
- I am able to understand all the help messages, if not, exchange with the PO or TW to rewrite them.
- After having created the PR, I will make sure that all the tests provided in this PR have run and passed.
It shouldn't exist (but it does)
Est-ce qu'il y a une convention Git de message de commit pour dire “c'est trop de la m…. je ne cautionne pas, et j'ai trop honte de voir mon nom gravé dans l'historique des commits” ? Il y a bien GLWTPL, mais ça c'est pour la licence.
J'ai vu des horreurs dans le code, déjà que j'aime pas les films d'horreurs mais là je suis choqué. et pas le temps de refactorer
Proposition :
- It shouldn't exist but it does.
- Abomination
- Aberration
- It saddens me to see this
- It should be forbidden / SHOULD BE BANNED
Autres
Règle d'organisation du dépôt
Règle d'organisation du dépôt
Les dépôts sont organisés selon une arborescence qui respecte les règles suivantes :
- le nom des répertoires est le plus explicite possible et ne contient pas d'accents et d'espaces (remplacer par un souligné),
- l'encodage des fichiers textes et des tables (type .csv) est en UTF-8,
- dans la mesure du possible, chaque nœud de l'arborescence contient un fichier Readme.md (en markdown) qui présente brièvement les répertoires
Source : https://sourcesup.renater.fr/www/si-snot/5_MO_VersionnementGit.html
Exemple de un unique dépôt pour plusieurs exécutables :
Notes ghost image système CloneZilla
Voir :
Mot de passe pour la console
| User | user |
| Password | live |
Autres
sudo su loadkeys fr lsblk grep linux /run/live/medium/boot/grub/grub.cfg cat /etc/ocs/ocs-live.conf ocs-live-restore
Error : Disk “” not found on the system!
Automatic cloning without confirmation
-batch
# ocs_live_extra_param="-batch -g auto -e1 auto -e2 -r -j2 -p true restoredisk my-image sda" ocs_live_extra_param="-g auto -e1 auto -e2 -r -j2 -p true restoredisk my-image sda"
Autres
ocs_live_run="ocs-live-general" ocs_live_run="ocs-live-restore"
Clavier
ocs_live_keymap="/usr/share/keymaps/i386/qwertz/fr_CH-utf8.kmap.gz" ocs_lang="en_US.UTF-8"
Autres
CloneZilla utilise sfdisk
LC_ALL=C grep -Ev '^last-lba:' sdb-pt.sf |sfdisk --wipe always --force /dev/sdb
sdb-pt.sf
label: gpt label-id: 2668D20F-7249-4150-978E-ECD8595A596A device: /dev/sdb unit: sectors first-lba: 34 last-lba: 1873280990 sector-size: 512
