How to get Git log with short stat in one line?

git log –oneline –pretty=”@%h” –stat |grep -v \| | tr “\n” ” ” | tr “@” “\n” This will show something like this: a596f1e 1 file changed, 6 insertions(+), 3 deletions(-) 4a9a4a1 1 file changed, 6 deletions(-) b8325fd 1 file changed, 65 insertions(+), 4 deletions(-) 968ef81 1 file changed, 4 insertions(+), 5 deletions(-)

excluding first and last lines from sed /START/,/END/

This should do the trick: sed -e ‘/=sec1=/,/=sec2=/ { /=sec1=/b; /=sec2=/b; s/^/#/ }’ < input This matches between sec1 and sec2 inclusively and then just skips the first and last line with the b command. This leaves the desired lines between sec1 and sec2 (exclusive), and the s command adds the comment sign. Unfortunately, you … Read more

How to split strings on carriage return with C#?

string[] result = input.Split(new string[] {“\n”, “\r\n”}, StringSplitOptions.RemoveEmptyEntries); This covers both \n and \r\n newline types and removes any empty lines your users may enter. I tested using the following code: string test = “PersonA\nPersonB\r\nPersonC\n”; string[] result = test.Split(new string[] {“\n”, “\r\n”}, StringSplitOptions.RemoveEmptyEntries); foreach (string s in result) Console.WriteLine(s); And it works correctly, splitting into … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)