Ir al contenido principal

How to get the path and name from git log

Hi people. The last day, I got a simple task, get all path and name from git log. In this case It's only necessary a console and project whit some commits

The simplest command is there:
git log --raw
This command get the name of author, date, commit and file affected. Is simple but is not for me, because I need the path and name of the file affected. Not all these data



The second command is here:
git log --pretty=format: --name-only
The command getting only the path and name; is just I needed. Not showing extra data, but it's separate by newline (later is necessary to delete for create a report for my boos)


If you need show the author and date, only add some parameters, for example

git log --pretty=format:"%an, %ar%n" --name-only

Another way for get only paths and names is there, the problem with this command is getting all files. You think, my project contains 10k files affected, the time to get all data is slow. This command is not insert newline for separate the paths and names.
git log --pretty=format: --name-only --diff-filter=A | sort -u


In my case I used the second command and added some parameters because I was filter by date, then I will write a report on excel, to remove duplicates files affected
git log --pretty=format: --name-only --since "nov 22 2022" --until "dec 9 2022"
This command is very helpful

Comentarios

Entradas populares de este blog

Northwind para Mysql y otras

Supongamos que necesitamos una base de datos para comenzar a hacer pruebas y a la vez necesitamos que esa base de datos contenga mucha información con la cual trabajar. En mis tiempos de universidad existía una base de datos que utilizábamos en los laboratorios con SQL Server y c# para mostrar los datos en algún formulario. El nombre era Northwind. El problema es que era solo para SQL Server, pero alguien en se dio a la tarea de exportar esa base de datos a MySql y es justo lo que te vengo a mostrar acá. Hace un tiempo atrás clone de los repositorios de Google Code   esa información (que como algunos de ustedes sabrá dejara de estar al servicio de todos en un tiempo). Modifique un poco la DB de Mysql para que se pudiera ejecutar el script sin ningún problema. Lo interesante de todo esto es que puedes utilizar los demás script para diferentes gestores de base de datos Se advierte que para poder usarlas adecuadamente hay que modificar los campos de tipo longblob y que hay un

How to upload File from form data POST in Android with Retrofit 2

 The last day I explain how to upload a simple CSV file using node . And now I teach how to upload from android device. Get source code here:  GitHub This article is write in java... later I'll add the method for kotlin. The logic is not changed, only the format code. 1) Is necessary add the dependencies in gradle: module implementation 'com.google.code.gson:gson:2.8.6' // RETROFIT // implementation 'com.squareup.retrofit2:retrofit:2.6.2' implementation 'com.squareup.retrofit2:converter-gson:2.6.2' implementation 'com.squareup.retrofit2:converter-scalars:2.5.0' 2) Add permissions in AndroidManifest.xml and modified the application for work with network security policy <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> in applitacion add

Abrir modal cuando se cargue la pagina web

Se advierte que blogger puede cambiar el resultado, pero tranquilo, te dejo un enlace donde lo puedes ver sin mas ni mas haciendo click aquí Una de las cosas interesantes de  usar Bootstrap en tus proyectos es que ya trae muchas funcionalidades como los modales. Algo en particular que me han preguntado mas de una vez es lo siguiente: ¿Puedo abrir un modal al momento de cargar una pagina web? La respuesta es un simple SI y te muestro como hacerlo de manera rápida Ahora simplemente tenemos que mandar a llamar un fragmento de código en nuestro JQuery: $(function(){ $("#myModal").modal(); }); Es algo simple cuando ya conoces la solución claro y espero te sirva mucho