Monday 1 February 2016

git patch create new files

Steps to add new files to patch : 

User@AMX-554 /C/xampp/htdocs
$ git clone --branch 8.x-1.x https://git.drupal.org/project/autologout.git
Cloning into 'autologout'...
remote: Counting objects: 1648, done.
remote: Compressing objects: 100% (1179/1179), done.
remote: Total 1648 (delta 982), reused 706 (delta 408) eceiving objects:  96% (1583/1648), 340.00 KiB | 19.00 KiB/s
Receiving objects: 100% (1648/1648), 362.41 KiB | 18.00 KiB/s, done.
Resolving deltas: 100% (982/982), done.
Checking connectivity... done.

User@AMX-554 /C/xampp/htdocs
$ cd autologout/



User@AMX-554 /C/xampp/htdocs/autologout (8.x-1.x)
$ git status
On branch 8.x-1.x
Your branch is up-to-date with 'origin/8.x-1.x'.

nothing to commit, working directory clean

User@AMX-554 /C/xampp/htdocs/autologout (8.x-1.x)

$ git add -N README.txt INSTALL.txt

User@AMX-554 /C/xampp/htdocs/autologout (8.x-1.x)

$ git add -p
warning: LF will be replaced by CRLF in INSTALL.txt.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in README.txt.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in INSTALL.txt.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in INSTALL.txt.
The file will have its original line endings in your working directory.
diff --git a/INSTALL.txt b/INSTALL.txt
index e69de29..7df4980 100644
--- a/INSTALL.txt
+++ b/INSTALL.txt
@@ -0,0 +1,16 @@
+INSTALL.txt file
+================
+$Id: INSTALL.txt,v 1.2 2009/04/17 14:05:51 jvandervort Exp $
+
+1. Place the autologout folder in your drupal/modules folder (or if multisite and this
+  module is meant to be available to just one site in drupal/sites/www.YOURSITE.com/modules)
+
+2. Enable the autologout module at administer > modules
+
+3. Ensure the correct admin users have permissions to administer the autologout module at
+  administer > people > permissions
+
+4. Set-up the module at administer > configure > people > autologout
+
+
+

Stage this hunk [y,n,q,a,d,/,e,?]? y
<stdin>:10: trailing whitespace.
1. Place the autologout folder in your drupal/modules folder (or if multisite and this
<stdin>:19: new blank line at EOF.
+
warning: 2 lines add whitespace errors.

warning: LF will be replaced by CRLF in README.txt.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in README.txt.
The file will have its original line endings in your working directory.
diff --git a/README.txt b/README.txt
index e69de29..2ed76d2 100644
--- a/README.txt
+++ b/README.txt
@@ -0,0 +1,20 @@
+/* $Id:
+
+Description
+===========
+After a given timeout has passed, users are given a configurable session expired prompt. They can reset the timeout, logout, or ignore it in which case they'll be logged out a
fter a the padding time has elapsed. This is all backed up by a server side logout if js is disable or bypassed.
+
+Features
+========
+* Configurable Global timeout and timeout padding. The latter determines how much time a user has to respond to the prompt and when the server side timeout will occur.
+* Configurable messaging.
+* Configurable redirect url, with the destination automatically appended.
+* Configure which roles will be automatically logged out.
+* Configure if a logout will occur on admin pages.
+* Integration with ui.dialog if available. This makes for attractive and more functional dialogs.
+* Configurable timeout based on role
+* Configurable timeout based on User
+* Configurable maximum timeout. Primarily used when a user has permission to change their timeout value, this will be a cap or maximum value they can use.
+* Order of presidence is, user timeout -> lowest role timeout -> global timeout
+* So if a user has a user timeout set, that is their timeout threshold, if none is set the lowest timeout value based on all the roles the user belongs to is used, if none is
set the global timeout is used
+* Roles with the proper permission setting can change their timeout value

Stage this hunk [y,n,q,a,d,/,e,?]? y

User@AMX-554 /C/xampp/htdocs/autologout (8.x-1.x)

$ git diff --cached --binary > add-readme-file-to-module-2658672-2.patch
warning: LF will be replaced by CRLF in INSTALL.txt.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in README.txt.
The file will have its original line endings in your working directory.

 
Reff links
 
http://stackoverflow.com/questions/14491727/git-add-patch-to-include-new-files