I found the solution, to use the Placeholders %d to get the desired information:
git log --pretty=format:"Author: %an Date: %as%nVersion: %d%nHistory: %s%n"
Type: Posts; User: Giorgik63
I found the solution, to use the Placeholders %d to get the desired information:
git log --pretty=format:"Author: %an Date: %as%nVersion: %d%nHistory: %s%n"
I need to use the following Git Log command:
git log --pretty=format:"Author: %an Date: %as%nVersion: %h%nHistory: %s%n" > header.txt
where I want to display the tag in the Version field....
thanks stahta01
Thanks for the advice, but my request arises from the need to have a history of its evolution and correction for each source .c / .h file. Git gives me the information on the evolution of the whole...
Hello everyone. Can you tell me if the CVS equivalent $Header$, $Date$, $log$ and $Id$, exists in Git for the C source code ?
Here is this piece of code as an example:
/* $Header$
* My Name...
echo " * Author: Giorgio Guglielmone Date: " `date` >> intestazione.txt
At the moment I wrote this:
#!/bin/bash
for file in *.c; do
echo "/*" > intestazione.txt
echo " * File Name: " $file >> intestazione.txt
echo " *" >> intestazione.txt
echo "...
Now it is a matter of reading the file name and inserting it in the header, then inserting the name of the author and reading the date of creation of the file, always inserting everything in the...
Yes, thank:
#!/bin/bash
for file in *.c; do
cat $1 $file > .tmp && mv .tmp $file
done
I would like to update all the files (.c / .h) of my project, using a script (for Linux), to add a fixed header of the following type:
/*
* <File Name>
* <Author>: <Date>:
...
Thank Salem.
Correct
echo 'const char *version = "'$(shell git describe --abbrev=4 --always --tags)'";' > version_info.c
I wrote a C program for both Linux and Windows.
I use Git to store versions of the code.
Is there a way to have the program version displayed when I start it ? Can you tell me how to write these...
I got there now. The solution is very simple:
CPLAT = LINUX
all: uno
uno:
gcc -D $(CPLAT) -c main.c
gcc -o test main.o
I'll explain. I have the following source code main.c:
#include <stdio.h>
int main(int argc, char *argv[]) {
#ifdef LINUX
printf("Ciao Linux\n");
#else
printf("Ciao Windows\n");
As a compiler I use gcc of MinGW in Windows 10 and gcc in Linux.
So far, I know too, but I would like to go command line with make, telling which platform to use in the build. Example: make WIN_USE...
I forgot, I use gcc as a compiler, both in Windows and Linux.
I wrote a C program in which valid instructions are used depending on the platform on which the program is to be started: Windows or Linux. In the C code I use #ifdef USE_WIN to say that that piece...
thanks john.c, I found on the Microsoft site that you have to use:
_setmode(_fileno(stdout), _O_BINARY);
obviously using between
#if (_WIN32) and #endif
in fact it works correctly.
Hello everyone. For my C study exercise, I wrote a program under Linux that converts any text file from Unix format to Windows (it involves changing the line terminator from LF to CRLF and vice...