git-tag-summary
vs git-tag-readme
index | OSiUX | archive | charlas | docs | links
dot
|
git
|
img
|
plt
|
tty
|
uml
aprovechar los tags de git
Varios de mis repositorios Git
1 no tenían mucha documentación
y por ello para contar con algo, que por un lado sea útil y que no me
lleve mucho tiempo generar, se me ocurrió crear un script para
automatizar la tarea de contar con un resumen de todos los tags.
Teniendo la disciplina de escribir un resumen del tag al momento de
generarlo, basta con ejecutar git tag -n
para contar con la data útil:
# git tag -n v0.1.0 first public version v0.2.0 fix dont ignore title and description in mr new v0.3.0 add shellcheck in gitlab-ci using koalaman/shellcheck-alpine image v0.4.0 set reviewer with default reviewer or assignee when default is empty in gl-mr-new
git-tag-summary
Para ponerle un poco de onda, git-tag-summary
2 se
ocupa de agregar la fecha del tag y por defecto arma un link del
tag a un documento con formato nombre-repo-tag.md
y todo en forma de
tabla Markdown
3
# git-tag-summary | _date_ | _tag_ | _description_ | |------------|---------------------------------------------|-----------------------------------------------------------------------------------| | 2022-08-20 | [` v0.4.0`](gitlab-bash-utils-v0.4.0.md) | set reviewer with default reviewer or assignee when default is empty in gl-mr-new | | 2022-08-20 | [` v0.3.0`](gitlab-bash-utils-v0.3.0.md) | add shellcheck in gitlab-ci using koalaman/shellcheck-alpine image | | 2022-08-04 | [` v0.2.0`](gitlab-bash-utils-v0.2.0.md) | fix dont ignore title and description in mr new | | 2022-08-04 | [` v0.1.0`](gitlab-bash-utils-v0.1.0.md) | first public version |
Si no necesitamos un link basta con definir la variable de entorno
NO_TAG_LINK=1
y el resultado se simplifica:
# NO_TAG_LINK=1 git-tag-summary | _date_ | _tag_ | _description_ | |------------|------------|-----------------------------------------------------------------------------------| | 2022-08-20 | ` v0.4.0` | set reviewer with default reviewer or assignee when default is empty in gl-mr-new | | 2022-08-20 | ` v0.3.0` | add shellcheck in gitlab-ci using koalaman/shellcheck-alpine image | | 2022-08-04 | ` v0.2.0` | fix dont ignore title and description in mr new | | 2022-08-04 | ` v0.1.0` | first public version |
La salida renderizada es la siguiente:
date | tag | description |
---|---|---|
2022-08-20 | v0.4.0 |
set reviewer with default reviewer or assignee when default is empty in gl-mr-new |
2022-08-20 | v0.3.0 |
add shellcheck in gitlab-ci using koalaman/shellcheck-alpine image |
2022-08-04 | v0.2.0 |
fix dont ignore title and description in mr new |
2022-08-04 | v0.1.0 |
first public version |
git-tag-readme
Aprovechando la salida de git-tag-summary
, fui por más y generé el
script git-tag-readme
4 que en un repo vacío se
ocupa de auto-genera un README.md
básico, con la descripción del
proyecto (en base al archivo .description
), el resumen de los tags,
agregando la información del autor y la licencia desde variables (por
defecto OSiUX
y GPLv3
5) y en caso de existir
.readme-header
y/o .readme-footer
los incluye y descarta info
auto-generada.
El resultado para el repo gitlab-bash-utils
6
es el siguiente:
# `gitlab-bash-utils` Useful bash scripts for various gitlab utils. ## _Tags Summary_ | _date_ | _tag_ | _description_ | |------------|------------|-----------------------------------------------------------------------------------| | 2022-08-20 | ` v0.4.0` | set reviewer with default reviewer or assignee when default is empty in gl-mr-new | | 2022-08-20 | ` v0.3.0` | add shellcheck in gitlab-ci using koalaman/shellcheck-alpine image | | 2022-08-04 | ` v0.2.0` | fix dont ignore title and description in mr new | | 2022-08-04 | ` v0.1.0` | first public version | ## License GNU General Public License, GPLv3. ## Author Information This repo was created in 2022 by [Osiris Alejandro Gómez](https://osiux.com/), worker cooperative of [gcoop Cooperativa de Software Libre](https://www.gcoop.coop/).
De esta manera, ahora puedo contar un README.md
en cada uno de mis
repos sin mucho esfuerzo y con la posibilidad de actualizarlos
fácilmente cada vez que genero un nuevo tag :)
Seguramente, en el futuro agregaré funcionalidades extra!
Tal vez te interese leer
git-tag-changelog
- Regenerar el archivo de configuración
.git/config
de un repositorio git - find value in all git tags using
git-find-value
- git auto commit and push using crontab.org
- Cómo configurar tokens de acceso personal a los repositorios de Git usando HTTPS
- cómo escribir rápidamente mensajes de commit de git usando vim
- cómo usar GitLab desde la línea de comandos
- git commit timesum
- cambiar la fecha de un commit usando
GIT_COMMITER_DATE
ChangeLog
2023-06-08 20:13
agregargit-tag-summary
vsgit-tag-readme