Re: [agl-dev-community] AGL test scenario

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Miner,

 

Thanks for the suggestion I will give it a try.

 

I am using pydriller and connecting to one of the repo. Do you have any repo details where I can test my scenario (any old repo only to test the scenario if allow). Could you help in my case I used below set of line to extract from git, can I used same for AGL repo also.

 

 

from pydriller import RepositoryMining

import sys

import csv

count=0

#Commit hash, Author name

filename="Demos2.csv"

fields=['hash','name']

row=[]

with open(filename, 'w',newline='') as csvfile:

    csvwriter=csv.DictWriter(csvfile,fieldnames=fields)

    csvwriter.writeheader()

    #writing the fields

    #csvwriter.writerow(fields)

for commit in RepositoryMining(‘Repo link’).traverse_commits():

    #print('Hash {}, author {}'.format(commit.hash, commit.author.name))

    temp1=commit.hash

    temp2=commit.author.name

    rows=[{'hash': temp1},{'name': temp2}]

    count=count+1

    with open(filename, 'a',encoding="utf-8",newline='') as csvfile:

        #csvwriter=csv.writer(csvfile)

        csvwriter=csv.DictWriter(csvfile,fieldnames=fields)

        #writing the data rows

        csvwriter.writerows(rows)

  #      rows=next(csvwriter)

   # print(count)

 

Best regards,

Jasbir

 

From: agl-dev-community@xxxxxxxxxxxxxxxxxxxxxxxxx [mailto:agl-dev-community@xxxxxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Walt Miner
Sent: Monday, January 6, 2020 9:39 AM
To: agl-dev-community@xxxxxxxxxxxxxxxxxxxxxxxxx
Subject: Re: [agl-dev-community] AGL test scenario

 

Hello Jasbir, 

You can extract historical data from git using the git log command, See 

 

 

for a complete set of options. 

 

I use it as part of script when I calculate the number of commits by developers. As an example I use this command to extract the changes between two tags in the repo.  This command also formats the output into rows you can import into Excel as semicolon separated records. 

 

git log $tag1..$tag2 --pretty=format:"%h ; $i ; %an ; %s" --no-merges

 

or if you want to see the changes between given dates you can use

 

git log --pretty=format:"%h ; $i ; %an ; %s" --no-merges --since=01–Jan-2019 --before=01–Jan-2020

 

or since a given date

 

git log --pretty=format:"%h ; $i ; %an ; %s" --no-merges --since=01-Jan-2019

 

 

I hope this helps. 

 

Regards,

Walt

 

Walt Miner

AGL Community Manager

The Linux Foundation

 

Visit us at:

 

 

 

 

On Sun, Jan 5, 2020 at 7:42 PM Jasbir10 via Lists.Automotivelinux.Org <jasbir.singh=capgemini.com@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

Hi Team,

 

I am very new to AGL, and I need to perform one sample test in AGL.

 

What are the pre-condition/ requirement to perform any action in AGL (System and software).

 

Scenario:

·       I want to extract the data from AGL repo and pass the record to excel.

·       I want to check how many number of commit in a particular file.

·       I need commit record and name who did commit.

·       Can it be possible in windows  (How we can perform this on windows based system)

·       How to perform this action by using API both in Linux and Windows.

 

Please guide me if on same, it will be great help to start with wonderful repo.

 

Best regards,

Jasbir

 

This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.

_._,_._,_

Links:

You receive all messages sent to this group.

View/Reply Online (#7961) | Reply To Group | Reply To Sender | Mute This Topic | New Topic

Your Subscription | Contact Group Owner | Unsubscribe [list-automotive-discussions82@xxxxxxxxxxx]

_._,_._,_

[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux