Re: Continous Integration (was: RE: Git v2.13.1 SHA1 very broken)

2017-07-02 Thread Adam Dinwoodie
On Tue, Jun 06, 2017 at 05:04:32PM +0200, Lars Schneider wrote:
> > On 06 Jun 2017, at 16:47, Jason Pyeron  wrote:
> > 
> > Do we have Jenkins (or something else) setup for Git?
> > 
> > We would be happy to donate (slave) VMs for cygwin builds og Git.  
> > 
> > -Jason Pyeron
> > 
> 
> We use TravisCI for Linux, Mac, and (in a special way) Windows: 
> https://travis-ci.org/git/git
> 
> Windows is not supported by TravisCI. We just use TravisCI to
> trigger a build on MS Azure and read the results:
> https://github.com/git/git/commit/029aeeed55f6bfe8014e8ffe5fc7a6f2e5b110fc
> 
> Maybe we could trigger a Cgywin build on your slaves in the same way?

I tried setting up a Cygwin Git build on AppVeyor a little while ago,
but the problem I found is that Cygwin builds are slow, particularly if
you want to also run the test suite.  I do the builds for the Cygwin
distribution on my normal PC (so reasonably powerful but definitely not
devoted to the purpose), and doing the build and running the default
tests takes in the region of 8 hours for the 64-bit build and 12 hours
for the 32-bit build.

At the moment, I'm trying to set up automated regular builds on my PC
using BuildBot.  I think that, short of someone donating some fairly
significant resources for Cygwin builds, that's going to be the closest
I'll be able to find for spotting problems early.  It's a project in my
currently limited spare time, though, and not something I've done
before, so it's taking a little while to get going.

Adam


Re: What's cooking in git.git (Jun 2017, #09; Fri, 30)

2017-07-02 Thread Philip Oakley

From: "Junio C Hamano" 

Here are the topics that have been cooking.  Commits prefixed with
'-' are only in 'pu' (proposed updates) while commits prefixed with
'+' are in 'next'.  The ones marked with '.' do not appear in any of
the integration branches, but I am still holding onto them.



Junio,
Is it possible to include a table of contents that lists the integration 
branches, split by your categories, to help find areas of interest?


[Graduated to "master"]
* topic list
[New Topics]
[Stalled]
[Cooking]
[Discarded]

The TOC wouldn't need the [] or * markings if that's a problem.
--
Philip



You can find the changes described here in the integration branches
of the repositories listed at

   http://git-blame.blogspot.com/p/git-public-repositories.html

--
[Graduated to "master"]

* ab/die-errors-in-threaded (2017-06-21) 1 commit
 



Why doesn't merge fail if message has only sign-off?

2017-07-02 Thread Kaartic Sivaraam
While trying to merge a branch using "git merge" if a merge
message consists only of a "Sign-off" line it doesn't fail.
To be consistent with the behaviour of "git commit" shouldn't the merge
fail?

-- 
Kaartic


DEAR FRIEND.

2017-07-02 Thread Mr Daouda Ali
Dear Friend,
   I am Mr.Daouda Ali the head of file department of Bank of
Africa(B.O.A) here in Burkina Faso / Ouagadougou. In my department we
discover an abandoned sum of (US$18 million US Dollars) in an account
that belongs to one of our foreign customer who died along with his
family in plane crash. It is therefore upon this discovery that I now
decided to make this business proposal to you and release the money to
you as the next of kin or relation to the deceased for the safety and
subsequent disbursement since nobody is coming for it. I agree that
40% of this money will be for you, while 60% would be for me. Then
after the money is been transferred into your account, I will visit
your country for an investment under your kind control.

You have to contact my Bank directly as the real next of kin of this
deceased account with next of kin application form. You have to send
me those your information below to enable me use it and get you next
of kin application form from bank, so that you will contact Bank for
the transfer of this money into your account.

Your Full Name___
Your Home Address
Your Age ___
Your Handset Number
Your Occupation ___

I am waiting for your urgent respond to enable us proceed further for
the transfer through my private e-mail(mrdaoudaa...@gmail.com)

Yours faithfully,
Mr.Daouda Ali


[PATCH] hooks: add script to HOOKS that allows adding notes from commit message

2017-07-02 Thread Kaartic Sivaraam
This script is a little different from others in that it uses THREE
hooks to acheive it's goal, which is to allow users to add notes for
a commit while writing the commit message. It's working isn't
guaranteed even if one of the hooks aren't executed.

It currently works in the following scenartios,

* commit
* commit --amend
* commit -t

>From what I'm aware of it's not possible to make it work
with 'merge' as there isn't any hook that checks the message
of a merge commit. The notes are extracted from the commit message
using the hook that checks the commit message.

Use cases other than those specified here aren't tested. It might/
might not be possible to use this script in other cases (with/without
modifications).

The usage of various hooks are as follows,

prepare-commit-msg: Used to add the template in which the user
enters the notes for the commit. Leaving it
doesn't add any notes for the commit.

commit-msg: Used to extract the notes from the commit message if
it exists and save it to a file. It removes the the
content between the template to avoid it being added
to the commit message.

post-commit: Used to check if the file with notes for the last commit
 exists and if it does, uses it to add notes for the commit.

 Note: It's often times an file with empty lines when notes
 aren't given for a commit. It would not be added as a note
 for the commit as 'git notes' doesn't accept files with
 empty lines.
---
 templates/hooks--commit-msg.sample | 28 +++
 templates/hooks--post-commit.sample| 18 +
 templates/hooks--prepare-commit-msg.sample | 43 +++---
 3 files changed, 80 insertions(+), 9 deletions(-)
 create mode 100644 templates/hooks--post-commit.sample

diff --git a/templates/hooks--commit-msg.sample 
b/templates/hooks--commit-msg.sample
index b58d1184a..b15b72906 100755
--- a/templates/hooks--commit-msg.sample
+++ b/templates/hooks--commit-msg.sample
@@ -15,6 +15,34 @@
 # SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p')
 # grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1"
 
+# START : NOTES FOR A COMMIT FROM COMMIT MESSAGE
+# Script that allows you to enter notes for a commit while entering the
+# commit message in the editor.
+#
+# **NOTE** : It depends on the "prepare-commit-msg" and "post-commit"
+# hooks. They are to be enabled for it to function correctly.
+NOTES_HEADER='-- NOTES : START --'
+NOTES_FOOTER='--- NOTES : END ---'
+GIT_DIR=`git rev-parse --git-dir`
+TEMP_NOTES_FILE="$GIT_DIR/.git/.NOTES_FOR_HEAD"
+
+save_notes_to_file() {
+  sed -n "/$NOTES_HEADER/,/$NOTES_FOOTER/ {
+/$NOTES_HEADER/n
+/$NOTES_FOOTER/ !{
+  p
+}
+  }" "$1" >"$TEMP_NOTES_FILE"
+}
+
+delete_notes_from_message() {
+  sed -i "/$NOTES_HEADER/,/$NOTES_FOOTER/ d" "$1"
+}
+
+grep -q -e "^$NOTES_HEADER" "$1" && save_notes_to_file "$1" && 
delete_notes_from_message "$1"
+# END : NOTES FOR A COMMIT FROM COMMIT MESSAGE
+
+
 # This example catches duplicate Signed-off-by lines.
 
 test "" = "$(grep '^Signed-off-by: ' "$1" |
diff --git a/templates/hooks--post-commit.sample 
b/templates/hooks--post-commit.sample
new file mode 100644
index 0..ed99f114a
--- /dev/null
+++ b/templates/hooks--post-commit.sample
@@ -0,0 +1,18 @@
+#! /bin/sh
+# The following script allows you to enter notes for a commit
+# while entering the commit message in the editor.
+# 
+# **NOTE** : It depends on the "commit-msg" and "pre-commit-msg"
+# hooks. They are to be enabled for it to function correctly.
+
+
+# START : NOTES FOR A COMMIT FROM COMMIT MESSAGE
+GIT_DIR=`git rev-parse --git-dir`
+TEMP_NOTES_FILE="$GIT_DIR/.NOTES-FOR-HEAD"
+
+if [ -e "TEMP_NOTES_FILE" ]
+then
+  git notes add -F $TEMP_NOTES_FILE
+  rm $TEMP_NOTES_FILE
+fi
+# END : NOTES FOR A COMMIT FROM COMMIT MESSAGE
diff --git a/templates/hooks--prepare-commit-msg.sample 
b/templates/hooks--prepare-commit-msg.sample
index 86b8f227e..364f66677 100755
--- a/templates/hooks--prepare-commit-msg.sample
+++ b/templates/hooks--prepare-commit-msg.sample
@@ -9,8 +9,13 @@
 #
 # To enable this hook, rename this file to "prepare-commit-msg".
 
-# This hook includes three examples.  The first comments out the
-# "Conflicts:" part of a merge commit.
+# This hook includes three examples.  The first one is a script
+# that allows you to enter notes for a commit while entering the
+# commit message in the editor.
+#
+# **NOTE** : The script described above depends on the "commit-msg"
+# and "post-commit" hooks. They are to be enabled for it to function
+# correctly.
 #
 # The second includes the output of "git diff --name-status -r"
 # into the message, just before the "git status" output.  It is
@@ -20,17 +25,37 @@
 # The third example adds a Signed-off-by line to the message, that can
 # still be edited.  This is rarely a 

[PATCH/RFC] hooks: replace irrelevant hook sample

2017-07-02 Thread Kaartic Sivaraam
The pre-commit-msg hook sample has an example that comments
the "Conflicts:" part of the merge commmit. It isn't relevant
anymore as it's done by default since 261f315b ("merge & sequencer:
turn "Conflicts:" hint into a comment", 2014-08-28).

Add an alternative example that replaces it to ensure there's
atleast one example that could be used just by enabling the hook.

Signed-off-by: Kaartic Sivaraam 
---
 This patch assumes that a previous patch that touched the commit
 template [1] has been appled. Else it could remove the information
 about the branch from the comments.

 
[1]:http://public-inbox.org/git/%3c20170630121221.3327-2-kaarticsivaraam91...@gmail.com%3E/raw
 
 templates/hooks--prepare-commit-msg.sample | 17 +
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/templates/hooks--prepare-commit-msg.sample 
b/templates/hooks--prepare-commit-msg.sample
index 86b8f227e..03783b3de 100755
--- a/templates/hooks--prepare-commit-msg.sample
+++ b/templates/hooks--prepare-commit-msg.sample
@@ -9,8 +9,9 @@
 #
 # To enable this hook, rename this file to "prepare-commit-msg".
 
-# This hook includes three examples.  The first comments out the
-# "Conflicts:" part of a merge commit.
+# This hook includes three examples.  The first removes the
+# comment lines that start with "# Please enter the" and
+# "# with" from the commit message.
 #
 # The second includes the output of "git diff --name-status -r"
 # into the message, just before the "git status" output.  It is
@@ -20,17 +21,17 @@
 # The third example adds a Signed-off-by line to the message, that can
 # still be edited.  This is rarely a good idea.
 
-case "$2,$3" in
-  merge,)
-@PERL_PATH@ -i.bak -ne 's/^/# /, s/^# #/#/ if /^Conflicts/ .. /#/; print' 
"$1" ;;
+sed -i '/# Please enter the .*/d' "$1"
+sed -i '/# with .*/d' "$1"
 
+# case "$2,$3" in
 # ,|template,)
 #   @PERL_PATH@ -i.bak -pe '
 #  print "\n" . `git diff --cached --name-status -r`
 #   if /^#/ && $first++ == 0' "$1" ;;
-
-  *) ;;
-esac
+#
+#  *) ;;
+# esac
 
 # SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p')
 # grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1"
-- 
2.11.0



Re: [PATCH] hooks: add signature to the top of the commit message

2017-07-02 Thread Kaartic Sivaraam
On Sat, 2017-07-01 at 13:31 -0700, Junio C Hamano wrote:
> That sounds like a sample that is there not because it would be
> useful, but because we couldn't think of any useful example.
> 
> IOW, I view it just as useful as a sample that does
> 
>   #!/bin/sh
>   echo "# useless cruft" >>"$1"
> 
> whose sole value is to demonstrate that you could affect what you
> see in the editor by modifying "$1".
I thought it would be useful as it could serve as a simple example
about what could be done using hooks and further would help save some
vertical spacing for users who are acquainted with that message and
wouldn't want to see it anymore.

Sending a typical patch as a follow-up.

Apart from that I would like to share a patch of my attempt to give
"notes" about a commit while writing the commit message itself. It was
an attempt to combine three hooks at once to achieve the outcome. I
just wanted to share it so that it might be of use to someone.

-- 
Kaartic