Sponsored Content
Top Forums Shell Programming and Scripting gets all files details committed to svn by a particular user [or all users] since a particular date Post 302584127 by linuxadmin on Thursday 22nd of December 2011 08:46:46 AM
Old 12-22-2011
Tools gets all files details committed to svn by a particular user [or all users] since a particular date

Here is a shell for printing committed person's:
1. Revision number
2. Name
3. Date of commit
4. Files committed.
5. committing comment
6. Date


I just made for my usage. May be helpful for you too.

Do as follows.

create a file
$ vi svn_get_user_committed_files_details.sh
press i
then copy & paste the following as it is. And then make the shell executable with the command chmod.
[Don't forget to change PROJECT path. Smilie]

Usage :
$ sh svn_get_user_committed_files_details.sh anySvnUName
or
$ sh svn_get_user_committed_files_details.sh
Code:
#!/bin/bash
#######Things need to change######### [
PROJECT="/home/smily/workspace/MyProj"
#Date format should be YYYY-MM-DD
DateFrom="2011-12-20"
#DateTo can be in YYYY-MM-DD or HEAD
DateTo="HEAD"
#######Things need to change######### ]

svnfile_log_all="/tmp/svnfile_log_all.txt"
svnListUNames="/tmp/svnListUNames.txt"
svnUserCommitted="/tmp/svnUserCommitted.txt"
uName="$1"

[ $DateTo == "HEAD" ] && DateFromTo="-r {$DateFrom}:HEAD" || DateFromTo="-r {$DateFrom}:{$DateTo}"
[ -f $svnfile_log_all ] && rm -f $svnfile_log_all
[ -f $svnListUNames ] && rm -f $svnListUNames
[ -f $svnUserCommitted ] && rm -f $svnUserCommitted

echo -e "\nPlease wait..\n"
svn log $DateFromTo -v $PROJECT > $svnfile_log_all

if [ -z $uName ]; then
cat $svnfile_log_all | awk -v uName=$uName '/^r[0-9]+ / {user=$3} /./ {print user} ' | grep -v "^$" |sort | uniq >> $svnListUNames
else
  if [ `cat $svnfile_log_all | grep "$uName" | wc -l` -gt "0" ]; then
          echo $uName > $svnListUNames 
  else
          echo -e "\n>>>>>user: $uName not committed any files.<<<<<" 
          exit 0
  fi
fi

echo -e "\n\nRepo Name: `cat $PROJECT/.svn/entries | grep "http://" | head -1`" >> $svnUserCommitted

while read uName
do 
echo -e "\n$uName committed files\n======================" >> $svnUserCommitted
cat $svnfile_log_all | awk -v uName=$uName '/^r[0-9]+ / {user=$3} /./{if (user==uName) {print}}' | grep -E "^   M|^   G|^   A|^   D|^   C|^   U" | awk '{print $2}' | sort >> $svnUserCommitted

echo -e "\n\nIn Detail:\n==========" >> $svnUserCommitted
cat $svnfile_log_all | awk -v uName=$uName '/^r[0-9]+ / {user=$3} /./{if (user==uName) {print}}' >> $svnUserCommitted
echo -e "\n"
done < $svnListUNames

echo -e "Log is in : $svnUserCommitted\n"
cat $svnUserCommitted

Changes / suggestions expected .. Smilie
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Selecting files between a user inputed date range

Hi all! I'm working on a KSH script to select files between a user inputed date range (stored in a variable) and then move them and unzip them. I'm stuck at how to get the files between the user inputed date range selected. Any help would be greatly appreciated! The files are as such: ... (6 Replies)
Discussion started by: kelldan
6 Replies

2. Solaris

user logon details

how can i identifying whose are logged in last few days,time and date also want. what i will do for get that information (2 Replies)
Discussion started by: sijocg
2 Replies

3. Shell Programming and Scripting

SVN activity of certain user

Hi there, I'm looking for some help to get a little script done that shows me (or counts) only the added lines from an SVN repository of one specific user. Anybody has an idea? Thanks, Michael (0 Replies)
Discussion started by: MichaelGiese
0 Replies

4. Solaris

Command History for a user with IP details

Hi We are sharing our envoirnment with our component teams. the plateform is SunOS 5.8 Generic_117350-41 sun4u sparc SUNW,Sun-Fire-V490. All team logs in the domain with same user and perform activities. Now for the system auditing purpose can somebody guide me how can I get the details when... (6 Replies)
Discussion started by: sukhvinder_Tm
6 Replies

5. UNIX and Linux Applications

SVN user permissions trouble

I am trying to add a user to my SVN server that can only access one of about a dozen repositories I have set up. Here are the files that I think need changed and what I have set them to. No matter what I try with these files I am unable to see the results I am after. In the end I want this new... (0 Replies)
Discussion started by: benn600
0 Replies

6. Solaris

How to integrate SVN client to SVN server repository.

Hi, I am new to SVN configuration on Solaris 10.I have installed SVN client version 1.7. bash-3.00# ./svn --version svn, version 1.7.4 (r1295709) compiled Mar 2 2012, 12:59:36 Here my requirement is how to integrate svn client to One of the SVN server repository. My repository... (0 Replies)
Discussion started by: muraliinfy04
0 Replies

7. Shell Programming and Scripting

To get the files in a directory for the given date (User entered date)

Need a ksh script to get the files that were created or modified in a directory on a particular date entered by the user. For example if a directory contains files as below : > ll total 41 -rw-rw-r-- 1 psn psn 199 Aug 23 07:06 psn_roll.sh -rw-rw-r-- 1 psn psn ... (10 Replies)
Discussion started by: ramprabhum
10 Replies

8. Shell Programming and Scripting

History of all the users in single file with command , date . time , ip and user

HTML Code archive_history() { HISTORYOLD=${HISTFILE}.archive CURTIME=`date` CURTTY=`tty` IP=$(echo $SSH_CLIENT | awk '{print $1}') if ; then echo "#-${HOSTNAME}-- ${CURBASHDATE} - ${CURTIME} ($CURTTY) ${USER} ${IP}----" >> $HISTORYOLD history... (2 Replies)
Discussion started by: rehantayyab82
2 Replies

9. Shell Programming and Scripting

History of all the users in single file with command , date . time , ip and user

HTML Code: archive_history() { HISTORYOLD=${HISTFILE}.archive CURTIME=`date` CURTTY=`tty` IP=$(echo $SSH_CLIENT | awk '{print $1}') if ; then echo "#-${HOSTNAME}-- ${CURBASHDATE} - ${CURTIME} ($CURTTY) ${USER} ${IP}----" >> $HISTORYOLD history... (0 Replies)
Discussion started by: rehantayyab82
0 Replies

10. Shell Programming and Scripting

Making post down hook script for svn regarding sending emails after an file is committed in svn

Hi Folks , I am asking this question but i apologise please if this is not the correct forum , I have to develop a shell script that i want to place in at hooks/post-commit , that is basically i have to develop a post hook script and the main functionality of that script would be lets say if... (0 Replies)
Discussion started by: sunsun06060606
0 Replies
UNBUFFER(1)                                                   General Commands Manual                                                  UNBUFFER(1)

NAME
unbuffer - unbuffer output SYNOPSIS
unbuffer program [ args ] INTRODUCTION
unbuffer disables the output buffering that occurs when program output is redirected from non-interactive programs. For example, suppose you are watching the output from a fifo by running it through od and then more. od -c /tmp/fifo | more You will not see anything until a full page of output has been produced. You can disable this automatic buffering as follows: unbuffer od -c /tmp/fifo | more Normally, unbuffer does not read from stdin. This simplifies use of unbuffer in some situations. To use unbuffer in a pipeline, use the -p flag. Example: process1 | unbuffer -p process2 | process3 CAVEATS
unbuffer -p may appear to work incorrectly if a process feeding input to unbuffer exits. Consider: process1 | unbuffer -p process2 | process3 If process1 exits, process2 may not yet have finished. It is impossible for unbuffer to know long to wait for process2 and process2 may not ever finish, for example, if it is a filter. For expediency, unbuffer simply exits when it encounters an EOF from either its input or process2. In order to have a version of unbuffer that worked in all situations, an oracle would be necessary. If you want an application-specific solution, workarounds or hand-coded Expect may be more suitable. For example, the following example shows how to allow grep to finish pro- cessing when the cat before it finishes first. Using cat to feed grep would never require unbuffer in real life. It is merely a place- holder for some imaginary process that may or may not finish. Similarly, the final cat at the end of the pipeline is also a placeholder for another process. $ cat /tmp/abcdef.log | grep abc | cat abcdef xxxabc defxxx $ cat /tmp/abcdef.log | unbuffer grep abc | cat $ (cat /tmp/abcdef.log ; sleep 1) | unbuffer grep abc | cat abcdef xxxabc defxxx $ BUGS
The man page is longer than the program. SEE ALSO
"Exploring Expect: A Tcl-Based Toolkit for Automating Interactive Programs" by Don Libes, O'Reilly and Associates, January 1995. AUTHOR
Don Libes, National Institute of Standards and Technology 1 June 1994 UNBUFFER(1)
All times are GMT -4. The time now is 08:40 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy